test(e2e): consolidate the automine test category#24343
Open
spalladino wants to merge 7 commits into
Open
Conversation
f5a11ea to
94e41a4
Compare
1690958 to
3e8fa90
Compare
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.
66ed168 to
dbbbf39
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