Skip to content

test(e2e): consolidate the automine test category#24343

Open
spalladino wants to merge 7 commits into
spl/e2e-consolidation-2from
spl/e2e-automine
Open

test(e2e): consolidate the automine test category#24343
spalladino wants to merge 7 commits into
spl/e2e-consolidation-2from
spl/e2e-automine

Conversation

@spalladino

@spalladino spalladino commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Motivation

The automine category is the largest remaining e2e group: a single in-process node running the
deterministic AutomineSequencer (one block per submitted tx, synchronous L1 publish, no committee,
prover, or validator), opted into via the AUTOMINE_E2E_OPTS preset. It was spread across 4 standalone
domain base classes (28 tests) and ~42 root e2e_*.test.ts files, each repeating the same
{ ...AUTOMINE_E2E_OPTS } spread at the call site. This consolidates them under one category base and a
behavior-organized tree, mirroring the single-node/multi-node work 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.ts is the category base, a sibling of SingleNodeTestContext:
both wrap fixtures/setup.ts:setup(), but AutomineTestContext fixes the automine topology and makes
AUTOMINE_E2E_OPTS (plus fundSponsoredFPC) the default, so tests pass numberOfAccounts instead of
spreading the preset. It exposes the common handles, a static setup<T> factory, markProvenAndWarp
(the documented mark-proven-then-warp idiom), registerContract, and applyManualParentChild.

The two thin domain bases (DeployTest, NestedContractTest) fold into the base; the two token bases
(TokenContractTest, BlacklistTokenContractTest) become composed harnesses that extend AutomineTestContext and run their TokenSimulator/snapshot/role-delay setup after super.setup(). Root
tests 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 under
    automine/contracts/{deploy,nested}/, e2e_storage_proof under automine/contracts/.
  • convert token + blacklist tests to automine harnesses — both token bases become harnesses; 17 test
    files + 2 harnesses under automine/token/.
  • move automine root tests + recategorize snapshot_sync — the 42 root tests bucketed under
    automine/{smoke,token,contracts,accounts,notes,execution,lifecycle}/.
  • re-bucket automine second level — review found execution/ and lifecycle/ had become grab-bags, so
    they are dissolved: notes/ is renamed to effects/ (and gains pruned_blocks), a new simulation/
    folder holds the AVM simulator / kernelless simulation / circuit recorder, the ABI-surface tests move
    into contracts/, and the genuine miscellany is flattened to the automine/ root. A second-level
    folder is created only when it earns its keep.
  • document the test category structure in a top-level README — rewrites end-to-end/README.md with a
    human overview of the five topology categories plus a detailed agent reference (base-class hierarchy,
    the hydrateFromContext harness pattern, the .parallel rule, CI discovery, and the relocated no-node
    tests). The relocated tests it points to land in the sibling no-node-relocations PR.

Hierarchy before → after

Before (root + domain dirs):

src/e2e_token_contract/         (token_contract_test.ts + 10 tests)
src/e2e_blacklist_token_contract/ (blacklist_token_contract_test.ts + 7 tests)
src/e2e_nested_contract/        (nested_contract_test.ts + 4 tests)
src/e2e_deploy_contract/        (deploy_test.ts + 4 tests)
src/e2e_storage_proof/
src/e2e_*.test.ts               (42 root automine tests + e2e_snapshot_sync)

After:

src/automine/
  automine_test_context.ts   README.md
  token/        token + blacklist harnesses, the 17 token/blacklist tests,
                amm lending nft orderbook crowdfunding_and_claim escrow
  contracts/    deploy/ nested/ + contract_updates static_calls nested_utility_calls
                storage_proof abi_types option_params state_vars (+ fixtures/)
  accounts/     account_contracts keys multiple_accounts_1_enc_key 2_pxes authwit scope_isolation
  effects/      note_getter pending_note_hashes partial_notes event_logs event_only
                offchain_effect offchain_payment large_public_event custom_message
                tx_effect_oracle pruned_blocks
  simulation/   avm_simulator kernelless_simulation circuit_recorder
  <root flat>:  smoke ordering double_spend phase_check mempool_limit card_game
                private_voting expiration_timestamp genesis_timestamp pxe

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 it carry the .parallel suffix so CI splits each it into its own
job. e2e_cheat_codes (no setup()) stays at root as a Phase 6 unit/integration relocation candidate.

Helpers

  • markProvenAndWarp(seconds) on the base composes cheatCodes.rollup.markAsProven() then
    warpL2TimeAtLeastBy(...) with the ordering required under automine (a long warp crosses many epochs
    with 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 copies
    in BlacklistTokenContractTest.crossTimestampOfChange and the prune/update root tests.
  • registerContract and the StatefulContractCtorArgs/ContractArtifactClass aliases lift from
    DeployTest onto the base; applyManualParentChild lifts from NestedContractTest.applyManual.

Local verification: full yarn build, yarn lint end-to-end, and yarn format --check are green after
each commit, and the test_cmds / compat_test_cmds generators list every automine file exactly once
(avm_simulator runs in test_cmds via 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

@spalladino spalladino added the S-do-not-merge Status: Do not merge this PR label Jun 26, 2026
@spalladino spalladino changed the title refactor(e2e): consolidate the automine test category test(e2e): consolidate the automine test category Jun 26, 2026
@spalladino spalladino force-pushed the spl/e2e-consolidation-2 branch from f5a11ea to 94e41a4 Compare June 26, 2026 20:55
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-do-not-merge Status: Do not merge this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant