Repository navigation
feat(e2e): add shared local node fixture plumbing - #44148
Conversation
✨ Files requiring CODEOWNER review ✨🧪 @MetaMask/qa (2 files, +149 -0)
|
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [b8bb32c]
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 7 warn · 🔴 0 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Adds generic port-allocation helpers and a chain-agnostic withFixtures extension point used by upcoming Tron/Solana/Bitcoin local-node support: - afterLocalNodesStart hook invoked once all local nodes are up; specs that need node handles inside their network mocks capture them here and close over them in testSpecificMock testSpecificMock intentionally keeps its single-argument contract: passing an extra positional argument would collide with existing mock helpers whose second parameter already means something else (e.g. mockTronApis(server, mockZeroBalance), setupAutoDetectMocking (server, testAddress), mockSnapSimpleKeyringAndSite(server, port)). No behavior change for existing tests.
b8bb32c to
076f057
Compare
Builds ready [076f057] [reused from d7b3a92]
⚡ Performance Benchmarks (Total: 🟢 14 pass · 🟡 8 warn · 🔴 3 fail)
Bundle size diffs: data not available. |



Description
This PR adds the shared plumbing that later local-node PRs build on: a central
ports.tsregistry and anafterLocalNodesStarthook in the fixtures flow.testSpecificMockis intentionally not passed{ localNodes }at this stage, keeping the surface minimal for this step. It is one reviewable step of a linear stack and was extracted from the earlier #43722/#43724 work. Validated by runningsend-eth.spec.ts(4/4 passing). Based on a freshmainand under 1000 changed lines.Changelog
CHANGELOG entry: null
Related issues
Part of the local-blockchain E2E initiative (WPN-536).
Extracted from #43722/#43724; supersedes their fixture-plumbing portion.
Manual testing steps
yarn build:testyarn test:e2e:single test/e2e/tests/transaction/send-eth.spec.ts --browser=chrome(expect 4/4 passing).Screenshots/Recordings
N/A — test infrastructure only, no user-facing UI change.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Test-only infrastructure with a backward-compatible optional hook;
ports.tsis unused until later stack PRs.Overview
Adds shared E2E infrastructure for upcoming local-blockchain work: a new
test/e2e/seeder/ports.tsmodule for TCP port validation, ephemeral allocation (getAvailablePorts), single/range availability checks, andparsePortRangestring parsing.Extends
withFixturesinhelpers.jswith an optionalafterLocalNodesStartcallback (default no-op), invoked right after local nodes are started and before contract seeding—so later tests can configure nodes without changing the core fixture flow.testSpecificMockis unchanged (still not given{ localNodes }in this step).Reviewed by Cursor Bugbot for commit 076f057. Bugbot is set up for automated code reviews on this repo. Configure here.