Skip to content

fix(ci): fix fork test infrastructure and make job advisory - #96

Merged
eric-ships merged 6 commits into
mainfrom
fix/fork-test-ci-sccache
May 29, 2026
Merged

eric-ships merged 6 commits into
mainfrom
fix/fork-test-ci-sccache

Conversation

@eric-ships

@eric-ships eric-ships commented May 29, 2026 •

Copy link
Copy Markdown
Collaborator

BOP-165

Motivation

The fork test CI had two infrastructure bugs that prevented it from running at all, and the job was blocking PR merges even though base-std is the spec forerunner. Divergences between base-std and base/base mean Rust needs to catch up, not that base-std PRs are wrong.

What changed

  • Removed rust-cache and scoped RUSTC_WRAPPER/SCCACHE_GHA_ENABLED to the "Build patched base-anvil binaries" step only. Both rust-cache and sccache-action were running cargo metadata in the base-std checkout directory (a pure Solidity repo with no Cargo.toml), causing every run to fail before building anything.
  • Fixed BASE_ANVIL_REF pinning: git clone --branch does not accept a commit SHA, so cloning was failing with "Remote branch not found". Now clones the named branch and verifies the HEAD SHA matches the pinned value, emitting a warning if the branch has moved.
  • Made the job advisory (continue-on-error: true): base-std is the spec forerunner. Test failures mean base/base needs to catch up, not that base-std PRs should be blocked.
  • Added a PR comment that finds and updates in place on each run, showing pass/fail counts and the full error for each failing test. Reports "did not run" if the build fails before tests execute.

Moving RUSTC_WRAPPER and SCCACHE_GHA_ENABLED from the global env block
to only the 'Build patched base-anvil binaries' step fixes the
'could not find Cargo.toml' failure: sccache-action and rust-cache
were running cargo metadata in the base-std checkout directory
(a pure Solidity repo with no Cargo.toml) before the build step
cd'd into BASE_ANVIL_DIR.

Also pins BASE_ANVIL_REF to a commit SHA instead of a branch name
so CI is reproducible and the branch cannot disappear.
rust-cache ran cargo metadata in the base-std checkout (a Solidity repo
with no Cargo.toml), causing the workflow to fail before building anything.
Removing it fixes the cargo metadata error; sccache in the build step still
provides caching for the actual Rust compilation.

Also fixes the base-anvil SHA pinning: git clone --branch does not accept
a commit SHA, so CI was failing with 'Remote branch <sha> not found'.
Solution: clone the named branch and then verify the HEAD SHA matches the
pinned value, emitting a warning if the branch has moved.
Fork tests now run with continue-on-error: true since base-std is the
spec forerunner — divergences mean base/base needs to catch up, not that
base-std PRs are wrong. The job still runs and surfaces all failures.

A step summary is written to the GitHub Actions Summary tab showing total
pass/fail counts and the list of failing tests with a note that failures
indicate Rust implementation lag, not base-std bugs.
Posts a summary comment directly on the PR after each run showing pass/fail
counts and the list of failing tests. Only runs on pull_request events (not
merge_group or workflow_dispatch where there is no PR to comment on).

Requires pull-requests: write permission.
Instead of posting a new comment on every CI run, finds the existing
fork-test-results comment (identified by an HTML marker) and updates
it in place. Falls back to creating a new comment on first run.

Each failing test now shows the test name and its full error inline:
  - **test_name**: `ErrorType(args)`
so divergences are immediately actionable without reading the logs.
When the build or run step fails before any tests execute, the output
file is empty or has 0 pass/fail counts. The comment now shows
'Fork tests did not run' with a link to the workflow logs instead of
the misleading 'all 0 passed' message.
@github-actions

github-actions Bot commented May 29, 2026 •

Copy link
Copy Markdown

⚠️ Fork tests: 6 failed, 584 passed

These failures indicate divergences where base/base needs to catch up to the base-std spec. This check is advisory and does not block merging.

Failing tests
  • test_createB20_revert_missingIsin(address,bytes32): Error != expected error: custom error 0xff5f85a2 != MissingRequiredField("isin"); counterexample: calldata=0x108bedc000000000000000000000000094f98aa9e097bcf00a112e3ff6a2a37b2b250fc1bb70213b78e8950079f7b564763ac7a61c4f6065a2182fe16c83034c0f462422 args=[0x94f98aA9E097BCF00a112E3fF6a2A37b2B250fc1, 0xbb70213b78e8950079f7b564763ac7a61c4f6065a2182fe16c83034c0f462422]
  • test_mint_revertOrder_role_beats_zeroRecipient(address,uint256): Error != expected error: InvalidReceiver(0x0000000000000000000000000000000000000000) != AccessControlUnauthorizedAccount(0x0000000000000000000000000000000000002a36, 0x154c00819833dac601ee5ddded6fda79d9d8b506b911b3dbd54cdb95fe6c3686); counterexample: calldata=0xc84192080000000000000000000000000000000000000000000000000000000000002a360000000000000000000000000000000000000000000000000000000000000993 args=[0x0000000000000000000000000000000000002a36, 2451]
  • test_transferFrom_revertOrder_allowance_beats_executorPolicy(address,address,address,uint256): Error != expected error: PolicyForbids(0x10be5173aff2a44e748bd9acd8b19fe34689581398a9db7ba2fb671e786ff7d8, 72057594037927937 [7.205e16]) != InsufficientAllowance(0x9e0D063d40Dd90f85591DE2BAff414255b20eBDd, 0, 178095081508149383032358363979832726162 [1.78e38]); counterexample: calldata=0xcf52db0a0000000000000000000000009e0d063d40dd90f85591de2baff414255b20ebdd0000000000000000000000004f6c4b2fd0b4a3cf10be9f61b8f927b37d94a04b000000000000000000000000428b26e09606191386d6cbe48cdf137a3a8276490000000000000000000000000003fcd985fbdd736c406602903b63c0691595b9 args=[0x9e0D063d40Dd90f85591DE2BAff414255b20eBDd, 0x4F6C4b2fD0b4a3cF10bE9F61b8f927b37D94a04b, 0x428B26E09606191386d6CBE48cdf137a3a827649, 88928551019098803375510962140759988909741497 [8.892e43]]

@base base deleted a comment from github-actions Bot May 29, 2026
@eric-ships eric-ships changed the title fix(ci): scope sccache env to build step and pin base-anvil-fork SHA fix(ci): fix fork test infrastructure and make job advisory May 29, 2026
@eric-ships
eric-ships merged commit a4c2131 into main May 29, 2026
8 checks passed
@eric-ships
eric-ships deleted the fix/fork-test-ci-sccache branch May 29, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants