Skip to content

test: removing some entries from live request allowlist by adding missing mocks #31504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 3, 2025

Conversation

seaona
Copy link
Contributor

@seaona seaona commented Apr 2, 2025

Description

Removing some entries from the live server allow list from our e2e, and adding their corresponding global mocks.

Open in GitHub Codespaces

Related issues

Fixes:

Manual testing steps

  1. All specs should continue to work normally

Screenshots/Recordings

n/a

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.

@seaona seaona requested a review from a team as a code owner April 2, 2025 07:37
Copy link
Contributor

github-actions bot commented Apr 2, 2025

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.

@metamaskbot metamaskbot added the team-qa QA team label Apr 2, 2025
@metamaskbot
Copy link
Collaborator

✨ Files requiring CODEOWNER review ✨

👨‍🔧 @MetaMask/extension-platform

  • test/e2e/mock-e2e-allowlist.js

@seaona seaona self-assigned this Apr 2, 2025
@seaona seaona added team-extension-platform Extension Platform team flaky tests labels Apr 2, 2025
@metamaskbot
Copy link
Collaborator

Builds ready [3262d48]
UI Startup Metrics (1164 ± 63 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1164105213816312111277
load1021926120662957995
domContentLoaded1015921119861967995
domInteractive16124661533
firstPaint78977120337879987
backgroundConnect10654799
firstReactRender18153941927
getState10431668
initialActions001001
loadScripts80670097460858916
setupStore7516278
WebpackHomeuiStartup21401746265216622332362
load16671353208314417621909
domContentLoaded16601350207714417571900
domInteractive161266101445
firstPaint224801800170242415
backgroundConnect271386133061
firstReactRender205533731198496
getState9324489
initialActions512642634
loadScripts16521346205414317471890
setupStore18624428219
FirefoxBrowserifyHomeuiStartup13941186190214214371735
load12531065172813812941573
domContentLoaded12521065172813812941573
domInteractive9937182298796
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2617118162543
firstReactRender23195042527
getState6412178
initialActions001001
loadScripts12271049169413712741543
setupStore6417267
WebpackHomeuiStartup15221332207915415761890
load13161152180814213701643
domContentLoaded13151152180714213701643
domInteractive9437172248995
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect23184752531
firstReactRender34284443542
getState8430589
initialActions102111
loadScripts12941133178114213481625
setupStore7527289
Bundle size diffs
  • background: 0 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 0 Bytes (0%)

'https://www.4byte.directory/api/v1/signatures/?hex_signature=0x39509351',
'https://www.4byte.directory/api/v1/signatures/?hex_signature=0x5f575529',
'https://www.4byte.directory/api/v1/signatures/?hex_signature=0x60806040',
'https://www.4byte.directory/api/v1/signatures/?hex_signature=0xd0e30db0',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ removed because we already have a mock for any signature in the mock-e2e file

'https://static.cx.metamask.io/api/v1/tokenIcons/1337/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.png',
'https://static.cx.metamask.io/api/v1/tokenIcons/1337/0xc6bdb96e29c38dc43f014eed44de4106a6a8eb5f.png',
'https://static.cx.metamask.io/api/v1/tokenIcons/56/0x0d8775f648430679a709e98d2b0cb6250d2887ef.png',
'https://static.cx.metamask.io/api/v1/tokenIcons/56/0x6b175474e89094c44da98b954eedeac495271d0f.png',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 1 mock added for all the tokenIcons entries which returns a 200

'https://on-ramp.api.cx.metamask.io/eligibility/mm-card?id=0x01a92b9df8ce522a8f98161a97378bfdb2cce64f2d4293657e7eefe818d9ffbc',
'https://on-ramp.api.cx.metamask.io/eligibility/mm-card?id=0xb1b1aa3036452bf32c1159266d1886279e4890ba907ed275e39fbc56906a8be2',
'https://on-ramp.api.cx.metamask.io/eligibility/mm-card?id=7ea301c0-6a98-11ef-a19e-f3acaa606eca',
'https://on-ramp.api.cx.metamask.io/eligibility/mm-card?id=8af26790-6a98-11ef-bee7-5553e37c0097',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 1 mock added for all the eligibility requests, no matter which id used

hjetpoluru
hjetpoluru previously approved these changes Apr 2, 2025
Copy link
Contributor

@hjetpoluru hjetpoluru left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

pnarayanaswamy
pnarayanaswamy previously approved these changes Apr 3, 2025
@seaona seaona added this pull request to the merge queue Apr 3, 2025
"59144": 1
},
"blocked-wallets": [
"0x106311b0651fd123d02B4c999CCA810712bb347B",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we actually need this huge list of addresses for a mock in a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a good point, possibly not. This data matches the exact real response we have now, so we get the closest to the prod environment, but happy to reduce it to a minimal data set, and it can always be expanded in the future, if needed. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reduced it to a minimal data set. Let's see if something breaks or if we can go on with this version

Copy link
Contributor Author

@seaona seaona Apr 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay some specs failed, so I had to add the required entries in the networks metadata. Now everything seems to work with the current data. There was 1 flaky test, but it seems unrelated to the changes (you can see older instances of this error in ci). I've run all jobs one more time and things are green.

I've set up another branch just to be sure, and run x5 that specific test and I could also see it failing intermittently with the same error:

https://github.com/MetaMask/metamask-extension/actions/runs/14240914690/job/39911085234?pr=31556

it seems to me some miss-configuration with the injected fixtures data, it can be tackled on a separate PR

Screenshot from 2025-04-03 13-06-44

@seaona seaona removed this pull request from the merge queue due to a manual request Apr 3, 2025
racitores
racitores previously approved these changes Apr 3, 2025
Copy link
Contributor

@racitores racitores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@seaona seaona dismissed stale reviews from racitores, pnarayanaswamy, and hjetpoluru via 3b3fb06 April 3, 2025 08:06
@metamaskbot
Copy link
Collaborator

Builds ready [47e15fe]
UI Startup Metrics (1192 ± 60 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1192106214366012251283
load10469311259551121971
domContentLoaded10409261249561121967
domInteractive16133241628
firstPaint7601291142398231971
backgroundConnect106365810
firstReactRender20144461934
getState11431669
initialActions001001
loadScripts826718103856864905
setupStore7513278
WebpackHomeuiStartup21941710249019223492429
load17081253210517018311961
domContentLoaded17011248210117018241951
domInteractive1713100111528
firstPaint18367153215024578
backgroundConnect3311255273865
firstReactRender181543521106194
getState1434134079
initialActions612652646
loadScripts16891242199416518151936
setupStore376279612728
FirefoxBrowserifyHomeuiStartup13911170200716614421792
load12471046185716113061634
domContentLoaded12471046185716113061634
domInteractive10042192268897
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect24165282449
firstReactRender22192922227
getState7427378
initialActions001001
loadScripts12251030183516112841606
setupStore6419367
WebpackHomeuiStartup14771274204014315331812
load12771098178813013211563
domContentLoaded12771098178713013211563
domInteractive9036158249197
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect2417130122432
firstReactRender33274443541
getState7429478
initialActions001011
loadScripts12551081169612512991541
setupStore8532579
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 351 Bytes (0.01%)
  • ui: 12.34 KiB (0.18%)
  • common: 63 Bytes (0%)

@hjetpoluru hjetpoluru self-requested a review April 3, 2025 12:39
@seaona seaona added this pull request to the merge queue Apr 3, 2025
Merged via the queue into main with commit e96f851 Apr 3, 2025
165 checks passed
@seaona seaona deleted the e2e-mocks-addition-1 branch April 3, 2025 13:30
@github-actions github-actions bot locked and limited conversation to collaborators Apr 3, 2025
@metamaskbot metamaskbot added the release-12.17.0 Issue or pull request that will be included in release 12.17.0 label Apr 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
flaky tests release-12.17.0 Issue or pull request that will be included in release 12.17.0 team-extension-platform Extension Platform team team-qa QA team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants