-
Notifications
You must be signed in to change notification settings - Fork 5.4k
test: split Solana WebSocket Mock setup logic from Websocket Mocks cp-13.3.1 #35552
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
Conversation
|
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. |
✨ Files requiring CODEOWNER review ✨🧪 @MetaMask/qa (2 files, +10 -9)
|
| ethConversionInUsd, | ||
| monConversionInUsd, | ||
| manifestFlags, | ||
| withSolanaWebSocket = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the first part of the refactor, the Websocket mock logic was joint with the Websocket setup.
As a second stage of this refactor, we now separate the 2, allowing flexibility
| localWebSocketServer = LocalWebSocketServer.getServerInstance(); | ||
| localWebSocketServer.start(); | ||
| // All specs use the same ws mocks. | ||
| // If we need custom ws mocks we can expand logic for supporting custom ws mocks like with http |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic has been updated, to be able to pass a mocks array with websocket mocks
| withSolanaWebSocket = { | ||
| server: false, | ||
| mocks: [], | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: WebSocket Server Setup Skipped
The withSolanaWebSocket parameter's type changed from a boolean to an object. If existing calls pass true, the Solana WebSocket server setup is silently skipped because true.server is undefined. This can cause unexpected test failures.
Additional Locations (2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If existing calls pass true, the Solana WebSocket server setup is silently skipped because true.server is undefined. This can caus
ℹ️ there are no existing calls as I've updated all the old references
📊 Page Load Benchmark ResultsCurrent Commit: 📄 https://metamask.github.io/test-dapp/Samples: 100 Summary
📈 Detailed Results
Results generated automatically by MetaMask CI |
Builds ready [d8cca1a]
UI Startup Metrics (1197 ± 62 ms)
Benchmark value 24 exceeds gate value 23 for chrome browserify home mean firstReactRender Benchmark value 5 exceeds gate value 1 for chrome browserify home mean initialActions Benchmark value 254 exceeds gate value 18 for chrome browserify home p95 backgroundConnect Benchmark value 13 exceeds gate value 1.2 for chrome browserify home p95 initialActions Benchmark value 33 exceeds gate value 29 for chrome webpack home mean getState Benchmark value 283 exceeds gate value 195 for chrome webpack home p95 getState Benchmark value 9 exceeds gate value 7 for chrome webpack home p95 initialActions Benchmark value 111 exceeds gate value 110 for firefox browserify home mean domInteractive Benchmark value 30 exceeds gate value 25 for firefox browserify home mean backgroundConnect Benchmark value 27 exceeds gate value 25 for firefox browserify home mean firstReactRender Benchmark value 5 exceeds gate value 1 for firefox browserify home mean initialActions Benchmark value 13 exceeds gate value 9 for firefox browserify home mean setupStore Benchmark value 258 exceeds gate value 195 for firefox browserify home p95 domInteractive Benchmark value 11 exceeds gate value 2 for firefox browserify home p95 initialActions Benchmark value 43 exceeds gate value 27 for firefox browserify home p95 setupStore Benchmark value 1630 exceeds gate value 1615 for firefox webpack home mean uiStartup Benchmark value 1396 exceeds gate value 1380 for firefox webpack home mean load Benchmark value 1396 exceeds gate value 1380 for firefox webpack home mean domContentLoaded Benchmark value 113 exceeds gate value 100 for firefox webpack home mean domInteractive Benchmark value 33 exceeds gate value 26 for firefox webpack home mean backgroundConnect Benchmark value 45 exceeds gate value 38 for firefox webpack home mean firstReactRender Benchmark value 4 exceeds gate value 1 for firefox webpack home mean initialActions Benchmark value 1372 exceeds gate value 1360 for firefox webpack home mean loadScripts Benchmark value 298 exceeds gate value 156 for firefox webpack home p95 domInteractive Benchmark value 55 exceeds gate value 50 for firefox webpack home p95 firstReactRender Benchmark value 11 exceeds gate value 2 for firefox webpack home p95 initialActions Sum of mean exceeds: 340ms | Sum of p95 exceeds: 581.8ms Sum of all benchmark exceeds: 921.8ms Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
LGTM ! |
davibroc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
As a follow-up of this PR, which separated the logic for setting up the Websocket, from the test steps, now this PR separates the logic for handling mocked wss requests from the setup websocket server.
This means that now we can pass an array of websocket mocks.
Note, that the websocket mocks are different from the regular Http mocks, they look like this:
and the logic for handling the mocks is also different, as we are handling this in our local websocket server. Meaning:
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist