test(e2e): consolidate the automine test category - #24343
Merged
Merged
Conversation
spalladino
force-pushed
the
spl/e2e-consolidation-2
branch
from
June 26, 2026 20:55
f5a11ea to
94e41a4
Compare
spalladino
force-pushed
the
spl/e2e-automine
branch
2 times, most recently
from
June 26, 2026 22:32
66ed168 to
dbbbf39
Compare
Base automatically changed from
spl/e2e-consolidation-2
to
merge-train/spartan-v5
June 29, 2026 07:20
spalladino
force-pushed
the
spl/e2e-automine
branch
from
June 29, 2026 13:09
d63fdf8 to
4474091
Compare
Collaborator
Flakey Tests🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
spalladino
force-pushed
the
spl/e2e-automine
branch
from
June 29, 2026 15:32
521ce5f to
eaee5fc
Compare
PhilWindle
approved these changes
Jun 29, 2026
spalladino
force-pushed
the
spl/e2e-automine
branch
from
June 29, 2026 17:19
eaee5fc to
349a39a
Compare
spalladino
enabled auto-merge (squash)
June 29, 2026 17:20
Add the automine category base context as a sibling of SingleNodeTestContext: it wraps fixtures/setup.ts:setup() with AUTOMINE_E2E_OPTS as the default, exposes the common test handles, and provides markProvenAndWarp, registerContract, and applyManualParentChild. Lands unused; the test moves follow in later commits. Adds the blanket automine flake group to .test_patterns.yml.
Fold DeployTest and NestedContractTest into AutomineTestContext: registerContract and the StatefulContractCtorArgs/ContractArtifactClass aliases move onto the base, and applyManual becomes applyManualParentChild. Move the deploy tests under automine/contracts/deploy/, the nested tests under automine/contracts/nested/, and e2e_storage_proof under automine/contracts/ (with its fixtures). Files with more than one top-level it gain the .parallel suffix. Adds the automine/contracts globs to both bootstrap.sh test-list arrays, extends the compat flatten branch to cover src/automine/*, repoints the storage_proof_fetcher eslint override, the snapshot-regen script, and the protocol-contracts fixture provenance comment.
Make TokenContractTest and BlacklistTokenContractTest extend AutomineTestContext:
they keep their TokenSimulator, opt-in base/mint snapshots, and the Role helper, and
run their domain setup after super.setup(). crossTimestampOfChange now delegates to
the base markProvenAndWarp, and the harness loggers move to the e2e:automine:token /
e2e:automine:blacklist namespaces. Move the 17 token/blacklist test files plus the two
harnesses under automine/token/ (blacklist files gain a blacklist_ prefix to avoid
collisions), switching each from setup({ ...AUTOMINE_E2E_OPTS }) to the base default
and naming each describe after its path. Files with more than one top-level it gain
the .parallel suffix.
Adds the automine/token glob to both bootstrap.sh arrays, repoints the access_control
flake entry, and updates the e2e_persistence harness import.
Move the 42 root AUTOMINE_E2E_OPTS tests under automine/ bucketed by behavior
(smoke, token, contracts, accounts, notes, execution, lifecycle), switching each
from setup(N, { ...AUTOMINE_E2E_OPTS }) to AutomineTestContext.setup({
numberOfAccounts: N }) and naming each describe after its path. Files with more
than one top-level it gain the .parallel suffix.
Preserve the e2e_avm_simulator AVM-dump bespoke CI line (re-pointed at
src/automine/execution/avm_simulator.test.ts, dump name kept) with the file excluded
from the generic execution glob, and keep kernelless_simulation excluded from the
compat glob against its new path. Add the new automine subfolder globs to both
bootstrap.sh arrays and repoint the lending / offchain_payment flake entries.
Recategorize e2e_snapshot_sync: its checkpoint-history and corrupted-snapshot-fallback
assertions rely on interval block production that the AutomineSequencer does not provide
without injected txs, so per the plan's fallback it stays on the production sequencer and
moves to single-node/sync/ alongside synching rather than forcing a flaky automine
conversion.
The execution/ and lifecycle/ buckets had become grab-bags, so they are dissolved. notes/ is renamed to effects/ (note discovery, events, offchain effects) and gains pruned_blocks (note rediscovery after a prune). A new simulation/ folder holds avm_simulator, kernelless_simulation, and the circuit recorder. The ABI/storage-surface tests (abi_types, option_params, state_vars) move into contracts/. The genuine miscellany (smoke, ordering, double_spend, phase_check, mempool_limit, card_game, private_voting, expiration_timestamp, genesis_timestamp, pxe) is flattened to the automine/ root: a second-level folder is created only when it earns its keep. CI test discovery in bootstrap.sh and the .test_patterns.yml path entry are updated to match; per-file describe titles are repointed to their new paths.
The compat_test_cmds simulation glob excluded both avm_simulator and kernelless_simulation, but the bespoke AVM-dump line that covers avm_simulator only exists in test_cmds. The previous execution/ compat glob excluded only kernelless, so avm_simulator ran in compat as a regular test; restore that by excluding only kernelless.
Rewrites end-to-end/README.md to serve two audiences: a succinct human overview (the five topology categories, a where-does-my-test-go guide, quick-start commands) and a detailed agent reference tail (base-class hierarchy, the hydrateFromContext harness pattern, the .parallel rule, CI discovery via bootstrap.sh's two arrays incl. the avm/kernelless special-cases, .test_patterns.yml, compose/HA run modes, relocated no-node tests, and support dirs). Preserves the legacy-artifacts section. The relocated no-node tests it references land in the sibling no-node-relocations PR.
The automine consolidation moved e2e_card_game.test.ts to automine/card_game.test.ts and e2e_crowdfunding_and_claim.test.ts to automine/token/crowdfunding_and_claim.parallel.test.ts. Update the references array and the two #include_code directives in call_types.md that still pointed at the old paths, which broke the docs build.
The 'failure cases' block asserts that set_admin / set_minter from t.adminAddress revert once it is no longer admin, which only held when the earlier 'Set admin' test had run. CI runs each test in isolation (--testNamePattern), so 'Set admin' was skipped, t.adminAddress was still admin, and the call succeeded instead of reverting. Move admin to account1 in the block's own beforeAll (idempotent) so the failure cases pass whether run alone or as part of the full suite.
The automine consolidation also moved e2e_deploy_contract/deploy_method.test.ts to automine/contracts/deploy/deploy_method.parallel.test.ts and e2e_event_logs.test.ts to automine/effects/event_logs.test.ts. Update the eight #include_code directives in how_to_deploy_contract.md and how_to_read_data.md that still pointed at the old paths; the docs build aborts on the first missing include, so these surfaced only after the call_types.md fix landed.
The .parallel split runs each top-level it() in its own container via --testNamePattern, but 'Set admin', 'Add minter as admin', and 'Revoke minter as admin' formed an ordered chain: the latter two acted as account1 (the admin established by 'Set admin') and reverted when run in isolation. Merge the three into a single self-contained 'Manages admin and minter roles' test that runs the full narrative from base state, so it passes whether run alone or with the suite.
The automine consolidation added the .parallel suffix to every converted test file, but CI runs each it() in a .parallel.test.ts in its own isolated container (jest --testNamePattern). Files whose it()s share state or run in sequence (progressive tokenSim mutation validated by afterEach check(), a describe-scope note/token created in one it() and used by another, lending positions built across deposit/borrow/repay its) break when each it() runs alone. Revert the 12 stateful token files to plain *.test.ts so they run as one ordered job again: blacklist_access_control, blacklist_shielding, blacklist_transfer_private, blacklist_transfer_public, blacklist_unshielding, crowdfunding_and_claim, lending, nft, transfer_in_public, transfer, transfer_to_private, transfer_to_public. Files whose its are independent (read-only constants, per-it deploy/mint) keep .parallel. Repoint the call_types.md include_code for crowdfunding_and_claim to the reverted path, and tighten the README .parallel rule: the suffix is for files with independent its, not merely files with more than one it().
The .parallel split runs each it() via run_test.sh ... "<name>" as a shell-quoted --testNamePattern regex. An embedded double-quote closes the quote early and hard-fails the job (pending_note_hashes); regex metacharacters like parens, brackets, and + silently match zero tests so the shard runs nothing and passes green, hiding the assertion. Drop quotes, parens, brackets, and + from the affected it/test names across the kept .parallel files (pending_note_hashes, 2_pxes, nested_utility_calls, offchain_effect, phase_check, smoke, access_control, escrow), keeping them readable. Document the naming constraint in the README .parallel section.
spalladino
force-pushed
the
spl/e2e-automine
branch
from
June 29, 2026 17:51
349a39a to
387e9dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The
autominecategory is the largest remaining e2e group: a single in-process node running thedeterministic
AutomineSequencer(one block per submitted tx, synchronous L1 publish, no committee,prover, or validator), opted into via the
AUTOMINE_E2E_OPTSpreset. It was spread across 4 standalonedomain base classes (28 tests) and ~42 root
e2e_*.test.tsfiles, each repeating the same{ ...AUTOMINE_E2E_OPTS }spread at the call site. This consolidates them under one category base and abehavior-organized tree, mirroring the
single-node/multi-nodework this PR is stacked on.Stacked on
spl/e2e-consolidation-2(PR for the single-node/multi-node/infra consolidation).Approach
A new
automine/automine_test_context.tsis the category base, a sibling ofSingleNodeTestContext:both wrap
fixtures/setup.ts:setup(), butAutomineTestContextfixes the automine topology and makesAUTOMINE_E2E_OPTS(plusfundSponsoredFPC) the default, so tests passnumberOfAccountsinstead ofspreading the preset. It exposes the common handles, a
static setup<T>factory,markProvenAndWarp(the documented mark-proven-then-warp idiom),
registerContract, andapplyManualParentChild.The two thin domain bases (
DeployTest,NestedContractTest) fold into the base; the two token bases(
TokenContractTest,BlacklistTokenContractTest) become composed harnesses thatextend AutomineTestContextand run theirTokenSimulator/snapshot/role-delay setup aftersuper.setup(). Roottests are routed through the base and organized by behavior. Test bodies and assertions are preserved
verbatim through every conversion.
The commits map to the plan's PR-split:
add AutomineTestContext base + helpers— base context, README, blanket flake group.fold deploy + nested contract tests into automine— deploy/nested tests underautomine/contracts/{deploy,nested}/,e2e_storage_proofunderautomine/contracts/.convert token + blacklist tests to automine harnesses— both token bases become harnesses; 17 testfiles + 2 harnesses under
automine/token/.move automine root tests + recategorize snapshot_sync— the 42 root tests bucketed underautomine/{smoke,token,contracts,accounts,notes,execution,lifecycle}/.re-bucket automine second level— review foundexecution/andlifecycle/had become grab-bags, sothey are dissolved:
notes/is renamed toeffects/(and gainspruned_blocks), a newsimulation/folder holds the AVM simulator / kernelless simulation / circuit recorder, the ABI-surface tests move
into
contracts/, and the genuine miscellany is flattened to theautomine/root. A second-levelfolder is created only when it earns its keep.
document the test category structure in a top-level README— rewritesend-to-end/README.mdwith ahuman overview of the five topology categories plus a detailed agent reference (base-class hierarchy,
the
hydrateFromContextharness pattern, the.parallelrule, CI discovery, and the relocated no-nodetests). The relocated tests it points to land in the sibling no-node-relocations PR.
Hierarchy before → after
Before (root + domain dirs):
After:
A second-level folder is created only when it earns its keep (a shared harness, an existing
sub-hierarchy, or a coherent domain of several files); the remaining miscellaneous protocol/execution
behaviors live as flat files directly under
automine/.Files with more than one top-level
itcarry the.parallelsuffix so CI splits eachitinto its ownjob.
e2e_cheat_codes(nosetup()) stays at root as a Phase 6 unit/integration relocation candidate.Helpers
markProvenAndWarp(seconds)on the base composescheatCodes.rollup.markAsProven()thenwarpL2TimeAtLeastBy(...)with the ordering required under automine (a long warp crosses many epochswith no proofs; without marking proven first, the pruning window resets the tip to genesis and the
warp's own empty-checkpoint propose fails with
Rollup__InvalidArchive). Replaces the verbatim copiesin
BlacklistTokenContractTest.crossTimestampOfChangeand the prune/update root tests.registerContractand theStatefulContractCtorArgs/ContractArtifactClassaliases lift fromDeployTestonto the base;applyManualParentChildlifts fromNestedContractTest.applyManual.Local verification: full
yarn build,yarn lint end-to-end, andyarn format --checkare green aftereach commit, and the
test_cmds/compat_test_cmdsgenerators list every automine file exactly once(avm_simulator runs in
test_cmdsvia the bespoke AVM-dump line and in compat as a regular test;kernelless_simulation is excluded from compat only). The
e2e tests themselves could not be run in this environment — the setup hook hits the 5-minute timeout on
untouched root automine tests too — so behavior verification is deferred to CI.
Part of A-1176