Skip to content

Commit e845e29

Browse files
spalladinoAztecBot
authored andcommitted
docs(e2e): update READMEs for the consolidated suite layout (#24518)
Updates every README in the e2e test section to describe the suite as it will look once the nine open round-2 consolidation PRs land. This is docs-only — no code, config, or `bootstrap.sh` changes. ## What changed per README - **`end-to-end/README.md`** (root): repointed the `LOG_LEVEL` example off the deleted `proving/empty_blocks.test.ts` to `proving/default_node.test.ts`; linked the new p2p README from the category table (the p2p row now reads "yes" and points at `src/p2p/README.md`); and renamed the `setupBlockProducer` submission-window literal `1024` to the named constant `NO_REORG_SUBMISSION_EPOCHS`. - **`end-to-end/src/single-node/README.md`**: rewrote the `cross-chain/` row for the merged layout (`CrossChainMessagingTest` + `message_test_helpers.ts`, and the `l1_to_l2` / `l1_to_l2_inbox_drift` / `l2_to_l1` / `token_bridge` files); folded `public_payments`/`sponsored_payments` into `private_payments.parallel` and fixed the stale `failures.parallel` name to `failures`; replaced `slasher_config`/`sequencer_config` with the merged `runtime_config`; replaced `world_state_pruning`/`empty_blocks` with the merged `default_node`; added the previously-missing `snapshot_sync` to the `sync/` row; and applied the `NO_REORG_SUBMISSION_EPOCHS` rename. - **`end-to-end/src/multi-node/README.md`**: named `equivocation_offenses` in the slashing row (in place of the separate `duplicate_proposal`/`duplicate_attestation` files) and applied the `NO_REORG_SUBMISSION_EPOCHS` rename in the `MOCK_GOSSIP_MULTI_VALIDATOR_OPTS` preset. - **`end-to-end/src/p2p/README.md`** (new): created with the content added by #24500. - **`end-to-end/src/automine/README.md`** and **`end-to-end/src/infra/README.md`**: untouched — both are behavior-level (no file names) or cover a directory none of the nine PRs change, so they remain accurate as-landed. --------- Co-authored-by: AztecBot <tech@aztec-labs.com> (cherry picked from commit 1cc5f91)
1 parent 94d794d commit e845e29

3 files changed

Lines changed: 49 additions & 30 deletions

File tree

yarn-project/end-to-end/README.md

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,21 @@ Run a single test (spawns its own in-process anvil):
1414

1515
```bash
1616
yarn test:e2e src/automine/token/access_control.parallel.test.ts
17-
yarn test:e2e src/single-node/block-building/block_building.test.ts -t 'rejects double spend'
17+
yarn test:e2e src/single-node/block-building/block_building.test.ts -t 'rejects a private then private double-spend'
1818
```
1919

2020
Turn up logging with `LOG_LEVEL` (`verbose` is the useful default; `debug:sequencer,archiver` scopes it):
2121

2222
```bash
23-
LOG_LEVEL=verbose yarn test:e2e src/single-node/proving/empty_blocks.test.ts
23+
LOG_LEVEL=verbose yarn test:e2e src/single-node/proving/default_node.test.ts
2424
```
2525

26+
Each run spawns anvil on port 8545, so two tests can only run side by side if each gets its own
27+
`ANVIL_PORT` (p2p tests additionally bind fixed p2p ports and can never run concurrently — see
28+
[`src/p2p/README.md`](src/p2p/README.md)). To shake flakiness out of a test,
29+
`scripts/deflaker.sh yarn test:e2e <file>` reruns it up to 100 times and stops at the first failure
30+
(output lands in `scripts/deflaker.log`).
31+
2632
Compose-based tests (those under `src/composed/`) need a running local network — see
2733
[Compose / HA / web3signer tests](#compose--ha--web3signer-tests).
2834

@@ -37,7 +43,7 @@ its environment, so a test file only describes the scenario, not the wiring.
3743
| [`automine/`](src/automine/README.md) | One node, deterministic `AutomineSequencer` — one block per tx, no committee/prover/validator. Fast. | it exercises contract or protocol behavior that doesn't depend on real block-building or consensus (transfers, nested calls, note discovery, tx semantics). | yes |
3844
| [`single-node/`](src/single-node/README.md) | One node, production sequencer (interval block production), optional prover. | it asserts on sequencer, proving, partial-proof, L1-reorg, recovery, fee, or cross-chain behavior on a single sequencer. | yes |
3945
| [`multi-node/`](src/multi-node/README.md) | N validators on an in-memory mock-gossip bus. | it needs a committee: consensus, attestations, slashing, governance, or multi-validator block production. | yes |
40-
| `p2p/` | Real libp2p transport between nodes. | the networking transport itself is under test (gossip, rediscovery, req/resp). | |
46+
| [`p2p/`](src/p2p/README.md) | Real libp2p transport between nodes. | the networking transport itself is under test (gossip, rediscovery, req/resp). | yes |
4147
| [`infra/`](src/infra/README.md) | Targets a deployed/external network (local anvil or a public testnet). | its concern is deployment or network targeting, not a specific protocol behavior. | yes |
4248

4349
A handful of tests live **outside** this package, next to the code they test — see
@@ -78,7 +84,7 @@ Each category centralizes its environment in a base class. The hierarchy:
7884
(both wrap `fixtures/setup.ts:setup()`), but fixes the automine topology and makes `AUTOMINE_E2E_OPTS`
7985
the default. Exposes `markProvenAndWarp`, `registerContract`, `applyManualParentChild`.
8086
- `p2p/p2p_network.ts`**`P2PNetworkTest`**. Real libp2p; node creation goes through
81-
`setup_p2p_test.ts`.
87+
`fixtures/setup_p2p_test.ts`.
8288
- `infra/` has no shared base — its tests target a network selected by `L1_CHAIN_ID` (local anvil in CI,
8389
a public testnet with credentials).
8490

@@ -91,8 +97,8 @@ Categories expose thin factories over their base's static `setup`, named by what
9197
calls the factory instead of spreading option presets:
9298

9399
- `single-node/setup.ts`: `setupWithProver` (fake in-process prover — the single-node default) and
94-
`setupBlockProducer` (no prover; raises `aztecProofSubmissionEpochs` to `1024` so unproven blocks
95-
aren't pruned, and points the PXE at `syncChainTip: 'proposed'`).
100+
`setupBlockProducer` (no prover; raises `aztecProofSubmissionEpochs` to `NO_REORG_SUBMISSION_EPOCHS`
101+
(1024) so unproven blocks aren't pruned, and points the PXE at `syncChainTip: 'proposed'`).
96102
- `automine` tests call `AutomineTestContext.setup({ numberOfAccounts })` directly.
97103

98104
### The harness pattern (domain setup on top of a category)
@@ -136,15 +142,20 @@ CI splits each `it` in a `.parallel.test.ts` file into its own docker job, runni
136142

137143
### CI test discovery — `bootstrap.sh`
138144

139-
`end-to-end/bootstrap.sh` enumerates tests in two arrays, and a test must appear in the relevant one or it
140-
**won't run in CI**:
145+
`end-to-end/bootstrap.sh` enumerates tests in two arrays, and a test must resolve through the relevant one
146+
or it **won't run in CI**:
141147

142-
- `test_cmds` (~line 37) — the standard run.
143-
- `compat_test_cmds` (~line 290) — the forward/legacy-compat run (a subset).
148+
- `test_cmds` — the standard run. Covers each category with a recursive glob (e.g.
149+
`src/automine/!(simulation)/**/*.test.ts`, `src/multi-node/**/*.test.ts`), so a new file or sub-folder
150+
inside an existing category is picked up automatically; only a new top-level category needs its own glob
151+
line. Tests with bespoke handling sit outside the globs: the `single-node/prover/` lanes at the top of
152+
the function (real proofs and custom resources under `CI_FULL`, `FAKE_PROOFS=1` otherwise) and
153+
`avm_simulator` (below).
154+
- `compat_test_cmds` — the forward/legacy-compat run (a subset). This one enumerates **single-level leaf
155+
globs** (e.g. `src/automine/token/*.test.ts`), so a new sub-folder whose tests should run against legacy
156+
contract artifacts needs its own line here.
144157

145-
Each leaf folder needs its own single-level glob line (e.g. `src/automine/token/*.test.ts`) in each array;
146-
globs are not recursive, so every sub-folder is listed explicitly. Folders that organize by behavior get
147-
one line per leaf. Bespoke handling to be aware of:
158+
Bespoke handling to be aware of:
148159

149160
- **`avm_simulator`** (`automine/simulation/avm_simulator.test.ts`) has a dedicated line in `test_cmds`
150161
that sets `DUMP_AVM_INPUTS_TO_DIR` (feeds the downstream `avm_check_circuit` job) and is therefore
@@ -153,8 +164,8 @@ one line per leaf. Bespoke handling to be aware of:
153164
- **`kernelless_simulation`** is excluded from `compat_test_cmds` only.
154165

155166
After editing the arrays, confirm every `*.test.ts` resolves through exactly one line (no duplicate, no
156-
omission). Per-test bash `TIMEOUT` overrides live in the `case` block in `test_cmds` and must stay in sync
157-
with the test's `jest.setTimeout`.
167+
omission — anything excluded via `!(...)` must be matched by its dedicated line). Per-test bash `TIMEOUT`
168+
overrides live in the `case` block in `test_cmds` and must stay in sync with the test's `jest.setTimeout`.
158169

159170
### Flaky tests — `.test_patterns.yml`
160171

@@ -190,11 +201,12 @@ These run in their own package's test lane (both packages already run anvil-back
190201

191202
### Support directories (not test categories)
192203

193-
- `fixtures/` — the shared `setup()`, option presets (`fixtures.ts`), `CrossChainTestHarness`,
194-
`l1_to_l2_messaging`, and common utils.
195-
- `shared/` — shared test bodies and `timing_env.mjs`, a **custom jest `testEnvironment`** referenced from
196-
this package's `package.json`. `yarn prepare` / the package-json check will try to revert it to the
197-
default — don't let it.
204+
- `fixtures/` — the shared `setup()`, option presets (`fixtures.ts`), the named node-level waiters
205+
(`wait_helpers.ts`), the span instrumentation (`timing.ts``testSpan`, zero-cost unless
206+
`TEST_TIMING_FILE` is set), `l1_to_l2_messaging`, and common utils.
207+
- `shared/` — shared test bodies, the `CrossChainTestHarness`, and `timing_env.mjs`, a **custom jest
208+
`testEnvironment`** referenced from this package's `package.json`. `yarn prepare` / the package-json
209+
check will try to revert it to the default — don't let it.
198210
- `simulators/` — in-TS reference models (`TokenSimulator`, `LendingSimulator`) used to assert contract
199211
behavior.
200212
- `test-wallet/`, `bench/`, `spartan/`, `quality_of_service/`, `forward-compatibility/` — helpers,

yarn-project/end-to-end/src/multi-node/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ copy-pasted:
3131
`getPrivateKeyFromIndex(i + 3)`), passed as `initialValidators`.
3232
- `MOCK_GOSSIP_MULTI_VALIDATOR_OPTS` — a tight committee on the mock bus with no prover
3333
(`{ mockGossipSubNetwork, skipInitialSequencer, startProverNode: false, aztecProofSubmissionEpochs:
34-
1024, numberOfAccounts: 0 }`). Tests that want a prover leave `startProverNode` explicit.
34+
NO_REORG_SUBMISSION_EPOCHS, numberOfAccounts: 0 }`, the constant re-exported from `../single-node/setup.ts`).
35+
Tests that want a prover leave `startProverNode` explicit.
3536
- `SLASHER_ENABLED_MULTI_VALIDATOR_OPTS` — the same committee with the slasher turned on, used by the
3637
offense-detection tests.
3738
- `defaultSlashingPenalties(unit?)` / `withOnlyOffense(offense, unit?)` — build the per-offense

0 commit comments

Comments
 (0)