Skip to content

feat(e2e): add shared local node fixture plumbing - #44148

Merged
ulissesferreira merged 1 commit into
mainfrom
wpn-536-local-node-plumbing
Jul 7, 2026
Merged

ulissesferreira merged 1 commit into
mainfrom
wpn-536-local-node-plumbing

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR adds the shared plumbing that later local-node PRs build on: a central ports.ts registry and an afterLocalNodesStart hook in the fixtures flow. testSpecificMock is 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 running send-eth.spec.ts (4/4 passing). Based on a fresh main and 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

  1. yarn build:test
  2. yarn 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

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Low Risk
Test-only infrastructure with a backward-compatible optional hook; ports.ts is unused until later stack PRs.

Overview
Adds shared E2E infrastructure for upcoming local-blockchain work: a new test/e2e/seeder/ports.ts module for TCP port validation, ephemeral allocation (getAvailablePorts), single/range availability checks, and parsePortRange string parsing.

Extends withFixtures in helpers.js with an optional afterLocalNodesStart callback (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. testSpecificMock is 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.

@metamask-ci metamask-ci Bot added the team-networks PRs from the Networks team label Jul 3, 2026
@metamask-ci

metamask-ci Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

✨ Files requiring CODEOWNER review ✨

🧪 @MetaMask/qa (2 files, +149 -0)
  • 📁 test/
    • 📁 e2e/
      • 📁 seeder/
        • 📄 ports.ts +144 -0
        • 📄 helpers.js +5 -0

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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.

@metamask-ci

metamask-ci Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor
Builds ready [b8bb32c]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 17 pass · 🟡 7 warn · 🔴 0 fail)

Baseline (latest main): 1716549 | Date: 6/29/2026 | Pipeline: 28667793306 | Baseline logs

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟡 [CI log]🟢 [CI log]
🔴 load_new_account
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 bridge_search_token

📈 Results compared to the previous 5 runs on main

  • ↓ loadNewAccount/load_new_account: -14%
  • ↓ loadNewAccount/total: -14%
  • ↓ loadNewAccount/inp: -26%
  • ↓ bridgeUserActions/longTaskCount: -17%
  • ↓ bridgeUserActions/tbt: -15%
  • ↓ bridgeUserActions/inp: -14%
  • ↑ loadNewAccount/load_new_account: +608%
  • ↑ loadNewAccount/total: +608%
  • ↓ loadNewAccount/inp: -26%
  • ↑ loadNewAccount/lcp: +1052%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↓ confirmTx/fcp: -48%
  • ↑ confirmTx/lcp: +1157%
  • ↑ bridgeUserActions/bridge_load_page: +117%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +52%
  • ↑ bridgeUserActions/bridge_search_token: +217%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +206%
  • ↓ bridgeUserActions/inp: -22%
  • ↑ bridgeUserActions/lcp: +1195%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 2.0s
  • 🟡 bridgeUserActions/FCP: p75 1.8s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
startupPowerUserHome
[Sentry log · main/release]
–🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/domInteractive: +51%
  • ↓ startupPowerUserHome/domInteractive: -16%
  • ↓ startupPowerUserHome/backgroundConnect: -12%
  • ↓ startupPowerUserHome/inp: -20%
  • ↓ startupPowerUserHome/fcp: -20%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 startupPowerUserHome/LCP: p75 3.5s
User Journey Benchmarks · Samples: 5 · mock API
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
🟡 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
importSrpHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
sendTransactions
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]
swap
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ onboardingImportWallet/metricsToWalletReadyScreen: -33%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -85%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -64%
  • ↓ onboardingImportWallet/longTaskCount: -80%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -93%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -89%
  • ↓ onboardingImportWallet/tbt: -98%
  • ↓ onboardingImportWallet/total: -83%
  • ↑ onboardingNewWallet/skipBackupToMetricsScreen: +13%
  • ↓ onboardingNewWallet/doneButtonToAssetList: -28%
  • ↓ onboardingNewWallet/longTaskCount: -50%
  • ↓ onboardingNewWallet/longTaskTotalDuration: -47%
  • ↓ onboardingNewWallet/longTaskMaxDuration: -19%
  • ↓ onboardingNewWallet/tbt: -52%
  • ↓ onboardingNewWallet/total: -24%
  • ↓ solanaAssetDetails/assetClickToPriceChart: -65%
  • ↓ solanaAssetDetails/total: -65%
  • ↑ solanaAssetDetails/lcp: +11%
  • ↑ solanaAssetDetails/cls: +1620%
  • ↓ importSrpHome/openAccountMenuAfterLogin: -18%
  • ↓ importSrpHome/homeAfterImportWithNewWallet: -25%
  • ↓ importSrpHome/longTaskCount: -35%
  • ↓ importSrpHome/longTaskTotalDuration: -40%
  • ↓ importSrpHome/longTaskMaxDuration: -35%
  • ↓ importSrpHome/tbt: -44%
  • ↓ importSrpHome/total: -24%
  • ↓ importSrpHome/inp: -42%
  • ↓ importSrpHome/lcp: -63%
  • ↓ importSrpHome/cls: -47%
  • ↓ sendTransactions/openSendPageFromHome: -26%
  • ↓ sendTransactions/selectTokenToSendFormLoaded: -51%
  • ↓ sendTransactions/reviewTransactionToConfirmationPage: -54%
  • ↓ sendTransactions/longTaskCount: -20%
  • ↓ sendTransactions/longTaskTotalDuration: -33%
  • ↓ sendTransactions/longTaskMaxDuration: -18%
  • ↓ sendTransactions/tbt: -100%
  • ↓ sendTransactions/total: -54%
  • ↓ sendTransactions/inp: -15%
  • ↓ sendTransactions/cls: -40%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 sendTransactions/FCP: p75 1.9s
  • 🟡 solanaAssetDetails/FCP: p75 1.8s
  • 🟡 sendTransactions/FCP: p75 1.8s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 70.31 KiB (0.64%)
  • ui: 45.51 KiB (0.26%)
  • common: 0 Bytes (0%)
  • other: 0 Bytes (0%)
  • contentScripts: 738 Bytes (0.04%)
  • zip: 36.58 KiB (0.14%)

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

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.
@ulissesferreira
ulissesferreira changed the base branch from wpn-536-local-node-deps to main July 6, 2026 09:42
@ulissesferreira
ulissesferreira force-pushed the wpn-536-local-node-plumbing branch from b8bb32c to 076f057 Compare July 6, 2026 09:46
@metamask-ci

metamask-ci Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor
Builds ready [076f057] [reused from d7b3a92]
Deprecated Browserify fallback builds
⚡ Performance Benchmarks (Total: 🟢 14 pass · 🟡 8 warn · 🔴 3 fail)

Baseline (latest main): 1716549 | Date: 6/29/2026 | Pipeline: 28782726127 | Baseline logs

Metricschrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 pwFormToMetricsScreen(p95) [CI log]🔴 [CI log]
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]

Regressions (🔴 3 failures)

Interaction Benchmarks · Samples: 5
Benchmarkchrome-webpackfirefox-webpack
loadNewAccount
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
confirmTx
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
bridgeUserActions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ loadNewAccount/load_new_account: -20%
  • ↓ loadNewAccount/total: -20%
  • ↓ bridgeUserActions/bridge_load_page: -28%
  • ↓ bridgeUserActions/bridge_load_asset_picker: -15%
  • ↓ bridgeUserActions/longTaskCount: -17%
  • ↓ bridgeUserActions/longTaskTotalDuration: -26%
  • ↓ bridgeUserActions/longTaskMaxDuration: -17%
  • ↓ bridgeUserActions/tbt: -40%
  • ↓ bridgeUserActions/inp: -14%
  • ↓ loadNewAccount/inp: -26%
  • ↑ loadNewAccount/lcp: +1119%
  • ↑ confirmTx/confirm_tx: +12%
  • ↓ confirmTx/longTaskCount: -100%
  • ↓ confirmTx/longTaskTotalDuration: -100%
  • ↓ confirmTx/longTaskMaxDuration: -100%
  • ↓ confirmTx/tbt: -100%
  • ↑ confirmTx/total: +12%
  • ↓ confirmTx/fcp: -47%
  • ↑ confirmTx/lcp: +1071%
  • ↑ bridgeUserActions/bridge_load_page: +114%
  • ↑ bridgeUserActions/bridge_load_asset_picker: +94%
  • ↓ bridgeUserActions/longTaskCount: -100%
  • ↓ bridgeUserActions/longTaskTotalDuration: -100%
  • ↓ bridgeUserActions/longTaskMaxDuration: -100%
  • ↓ bridgeUserActions/tbt: -100%
  • ↑ bridgeUserActions/total: +45%
  • ↓ bridgeUserActions/inp: -14%
  • ↑ bridgeUserActions/fcp: +12%
  • ↑ bridgeUserActions/lcp: +1189%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 loadNewAccount/FCP: p75 1.8s
  • 🟡 bridgeUserActions/FCP: p75 1.9s
Startup Benchmarks · Samples: 100
Benchmarkchrome-webpackfirefox-webpack
startupStandardHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
startupPowerUserHome
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↑ startupStandardHome/domInteractive: +10%
  • ↑ startupStandardHome/firstPaint: +13%
  • ↑ startupStandardHome/setupStore: +22%
  • ↑ startupStandardHome/numNetworkReqs: +45%
  • ↑ startupStandardHome/inp: +13%
  • ↑ startupPowerUserHome/domInteractive: +22%
  • ↓ startupStandardHome/domInteractive: -25%
  • ↓ startupStandardHome/fcp: -24%
  • ↑ startupPowerUserHome/domInteractive: +21%
  • ↑ startupPowerUserHome/inp: +20%
  • ↑ startupPowerUserHome/fcp: +17%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🔴 startupPowerUserHome/INP: p75 552ms
  • 🟡 startupPowerUserHome/INP: p75 264ms
  • 🟡 startupPowerUserHome/LCP: p75 3.7s
User Journey Benchmarks · Samples: 5 · mock API 🔴 3
Benchmarkchrome-webpackfirefox-webpack
onboardingImportWallet
[Sentry log · main/release]
🔴 [CI log]
🔴 doneButtonToHomeScreen
🔴 total
🔴 [CI log]
🔴 total
onboardingNewWallet
[Sentry log · main/release]
🟢 [CI log]🔴 [CI log]
🔴 total
assetDetails
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
solanaAssetDetails
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
importSrpHome
[Sentry log · main/release]
🟢 [CI log]🟢 [CI log]
sendTransactions
[Sentry log · main/release]
🟢 [CI log]🟡 [CI log]
swap
[Sentry log · main/release]
🟡 [CI log]🟡 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ onboardingImportWallet/metricsToWalletReadyScreen: -12%
  • ↓ onboardingImportWallet/doneButtonToHomeScreen: -16%
  • ↓ onboardingImportWallet/openAccountMenuToAccountListLoaded: -15%
  • ↓ onboardingImportWallet/longTaskCount: -60%
  • ↓ onboardingImportWallet/longTaskTotalDuration: -84%
  • ↓ onboardingImportWallet/longTaskMaxDuration: -83%
  • ↓ onboardingImportWallet/tbt: -92%
  • ↓ onboardingImportWallet/total: -21%
  • ↑ onboardingNewWallet/longTaskCount: +50%
  • ↑ solanaAssetDetails/assetClickToPriceChart: +38%
  • ↑ solanaAssetDetails/total: +38%
  • ↓ importSrpHome/openAccountMenuAfterLogin: -31%
  • ↓ importSrpHome/longTaskCount: -11%
  • ↓ importSrpHome/longTaskTotalDuration: -22%
  • ↓ importSrpHome/longTaskMaxDuration: -26%
  • ↓ importSrpHome/tbt: -31%
  • ↓ importSrpHome/inp: -36%
  • ↓ importSrpHome/fcp: -15%
  • ↓ importSrpHome/lcp: -59%
  • ↓ importSrpHome/cls: -47%
  • ↑ sendTransactions/openSendPageFromHome: +15%
  • ↓ sendTransactions/selectTokenToSendFormLoaded: -47%
  • ↓ sendTransactions/reviewTransactionToConfirmationPage: -17%
  • ↓ sendTransactions/longTaskCount: -20%
  • ↓ sendTransactions/longTaskTotalDuration: -27%
  • ↓ sendTransactions/longTaskMaxDuration: -12%
  • ↓ sendTransactions/tbt: -62%
  • ↓ sendTransactions/total: -17%
  • ↓ sendTransactions/cls: -40%
  • ↓ swap/fetchAndDisplaySwapQuotes: -51%
  • ↓ swap/longTaskCount: -100%
  • ↓ swap/longTaskTotalDuration: -100%
  • ↓ swap/longTaskMaxDuration: -100%
  • ↓ swap/tbt: -100%
  • ↓ swap/total: -50%
  • ↓ swap/cls: -63%

🌐 Core Web Vitals — 🟢 good · 🟡 needs improvement · 🔴 poor (web.dev thresholds)

  • 🟡 swap/FCP: p75 1.8s
  • 🟡 solanaAssetDetails/FCP: p75 1.9s
  • 🟡 sendTransactions/FCP: p75 2.0s
  • 🟡 sendTransactions/LCP: p75 2.5s
  • 🟡 swap/FCP: p75 1.9s
Dapp Page Load Benchmarks · Samples: 100
Benchmarkchrome-webpack
dappPageLoad
[Sentry log · main/release]
🟢 [CI log]

📈 Results compared to the previous 5 runs on main

  • ↓ dappPageLoad/pageLoadTime: -17%

Bundle size diffs: data not available.

@ulissesferreira
ulissesferreira marked this pull request as ready for review July 6, 2026 13:30
@ulissesferreira
ulissesferreira requested a review from a team as a code owner July 6, 2026 13:30
@ulissesferreira
ulissesferreira added this pull request to the merge queue Jul 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 7, 2026
@ulissesferreira
ulissesferreira added this pull request to the merge queue Jul 7, 2026
Merged via the queue into main with commit 09da33f Jul 7, 2026
180 checks passed
@ulissesferreira
ulissesferreira deleted the wpn-536-local-node-plumbing branch July 7, 2026 09:53
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 7, 2026
@metamaskbot metamaskbot added the release-13.40.0 Issue or pull request that will be included in release 13.40.0 label Jul 7, 2026

This branch was previously deployed

1 inactive deployment
pr-comment — 076f0570 Deployed Jul 6, 2026 by ulissesferreira via identify-codeowners #69608
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.40.0 Issue or pull request that will be included in release 13.40.0 risk:low size-M team-networks PRs from the Networks team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants