Skip to content

test(e2e): consolidate automine contracts and effects suites#24490

Open
spalladino wants to merge 2 commits into
merge-train/spartan-v5from
spl/e2e-r2-automine-misc
Open

test(e2e): consolidate automine contracts and effects suites#24490
spalladino wants to merge 2 commits into
merge-train/spartan-v5from
spl/e2e-r2-automine-misc

Conversation

@spalladino

@spalladino spalladino commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Round-2 e2e consolidation (PR 2 of 9), scoped to automine/contracts/**, automine/effects/**, automine/accounts/scope_isolation.test.ts, and automine/mempool_limit.test.ts. All 8 touched files pass locally.

Merges (old → new)

  • effects/{event_only.test.ts, custom_message.parallel.test.ts, large_public_event.test.ts}effects/events.test.ts — one beforeAll node, per-contract describe blocks. custom_message loses its .parallel suffix (bodies are tiny; one container is a net win). 3 files → 1.
  • contracts/nested/{manual_private_call.test.ts, manual_public.parallel.test.ts, manual_private_enqueue.parallel.test.ts}contracts/nested/manual_calls.test.ts — single beforeAll deploying a shared Parent/Child; the public and enqueued-call suites redeploy a fresh Child per test because each asserts an absolute post-increment storage value that only holds from a zero start. 3 files → 1.

Table / de-parallel conversions

  • accounts/scope_isolation.test.ts — the external private / external utility describes (structural duplicates differing only by a _utility method suffix) collapsed via describe.each.
  • contracts/option_params.parallel.test.tscontracts/option_params.test.ts (plain) + it.each over the public/utility/private variants.
  • contracts/nested_utility_calls.parallel.test.tscontracts/nested_utility_calls.test.ts (plain). See decision below.

nested_utility_calls decision

The file has two describes with genuinely different setups — the first uses a plain PXE, the second registers a custom pxeCreationOptions.hooks.authorizeUtilityCall. Per-container isolation was not the point (all bodies are fast simulate() calls with no cross-test shared state; the hook describe already resets its state in beforeEach), so I converted it to a single plain file with both describes, each keeping its own beforeAll (two sequential node bootstraps in one container — a CPU win over the previous 14 per-it containers). Within the hook describe the deny/allow × utility/private/view sextet is now an it.each; the two default-deny cases in the first describe are also tableized. The msg_sender and note-sync tests stay explicit. Runs in well under the container timeout locally.

Added assertions for previously zero-assertion its

  • manual_calls "performs a nested private call": now simulates parent.entry_point → child.value(0) and asserts it returns the same preimage as a direct child.value(0) call, in addition to sending the tx for on-chain inclusion.
  • manual_calls "performs public nested calls": now routes pub_entry_point → pub_inc_value(42) on a fresh child and asserts child storage is 42 (was assertion-free).
  • importer.parallel (stays .parallel, titles unchanged): call_no_args asserts the imported call returns the Test contract address; call_public_fn and pub_call_public_fn assert the nullifier landed by checking that re-emitting it on the Test contract is rejected as a duplicate.

Other

  • contracts/state_vars.test.ts: extracted a file-local expectInitialized(interaction, expected) helper replacing ~15 repeated is_*_initialized simulate+expect blocks.
  • mempool_limit.test.ts: removed the explicit no-op proverTestVerificationDelayMs: undefined option.

Dropped assertions

None. Every asserted behavior is preserved; the zero-assertion its gained real assertions rather than losing any. Test discovery and the compat suite are glob-based, so no bootstrap.sh / .test_patterns.yml edits were needed.

Round-2 consolidation of the automine contracts/effects/accounts tests.

- Merge effects/{event_only,custom_message.parallel,large_public_event} into
  effects/events.test.ts (one node, per-contract describes).
- Merge contracts/nested/{manual_private_call,manual_public.parallel,
  manual_private_enqueue.parallel} into contracts/nested/manual_calls.test.ts
  (single beforeAll, fresh child per test only where storage is asserted).
- Add real assertions to the previously zero-assertion nested-call and importer
  tests (child state / return values / duplicate-nullifier effects).
- Convert contracts/static_calls.test.ts to an it.each table, collapse
  accounts/scope_isolation.test.ts via describe.each, and de-parallel
  contracts/{option_params,nested_utility_calls} into plain files with tables.
- Extract a file-local expectInitialized helper in contracts/state_vars.test.ts.
- Drop the no-op proverTestVerificationDelayMs option in mempool_limit.test.ts.
@spalladino spalladino added the wip Work in progress label Jul 3, 2026
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.

1 participant