Skip to content
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

test: Improve test for signatures #27532

Merged
merged 9 commits into from
Nov 14, 2024
Merged

test: Improve test for signatures #27532

merged 9 commits into from
Nov 14, 2024

Conversation

pnarayanaswamy
Copy link
Contributor

@pnarayanaswamy pnarayanaswamy commented Oct 1, 2024

Description

The current mock server setup injects all mocks at the beginning of the test, which can lead to delays. Specifically, when we assert the account details opened metric, only the relevant endpoint for that metric gets triggered, while other mocks, like "signature approved," may not be invoked yet. Although this doesn’t cause the test to fail, it results in unnecessarily long wait times during the test, as the framework waits for mocks that haven’t been triggered.

This PR addresses the issue by moving the metric assertions to the end of the test. By doing so, we eliminate the idle waiting period, streamlining the test flow and reducing overall test execution time.

Open in GitHub Codespaces

Related issues

Fixes: #19823

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

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.

@pnarayanaswamy pnarayanaswamy requested a review from a team as a code owner October 1, 2024 11:24
Copy link
Contributor

github-actions bot commented Oct 1, 2024

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.

@Shathath
Copy link

Shathath commented Oct 1, 2024

1.Test

@metamaskbot
Copy link
Collaborator

Builds ready [208f811]
Page Load Metrics (1749 ± 100 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint24022121668385185
domContentLoaded13722172171619091
load137922171749207100
domInteractive15101422512
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [bdd8694]
Page Load Metrics (1864 ± 239 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint53935871790573275
domContentLoaded142334861833476229
load145435741864497239
domInteractive19116472512
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

Copy link

sonarcloud bot commented Oct 2, 2024

@metamaskbot
Copy link
Collaborator

Builds ready [d6eb293]
Page Load Metrics (1698 ± 134 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint142727381702269129
domContentLoaded141927131682265127
load142727951698279134
domInteractive1498432110
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@metamaskbot
Copy link
Collaborator

Builds ready [bb86ca4]
Page Load Metrics (1990 ± 162 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint32930311814578277
domContentLoaded160929151952309148
load161730331990338162
domInteractive158541199
backgroundConnect7119333416
firstReactRender493091145627
getState5104342914
initialActions01000
loadScripts115222851428266128
setupStore11110242211
uiStartup181334092255424204
Bundle size diffs
  • background: 0 Bytes (0.00%)
  • ui: 0 Bytes (0.00%)
  • common: 0 Bytes (0.00%)

@pnarayanaswamy pnarayanaswamy added this pull request to the merge queue Nov 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2024
@pnarayanaswamy pnarayanaswamy added this pull request to the merge queue Nov 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2024
@pnarayanaswamy pnarayanaswamy added this pull request to the merge queue Nov 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 14, 2024
@pnarayanaswamy pnarayanaswamy added this pull request to the merge queue Nov 14, 2024
Merged via the queue into develop with commit 8441041 Nov 14, 2024
76 checks passed
@pnarayanaswamy pnarayanaswamy deleted the signature-e2e branch November 14, 2024 13:02
@github-actions github-actions bot locked and limited conversation to collaborators Nov 14, 2024
@metamaskbot metamaskbot added the release-12.8.0 Issue or pull request that will be included in release 12.8.0 label Nov 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-12.8.0 Issue or pull request that will be included in release 12.8.0 team-confirmations Push issues to confirmations team
Projects
None yet
5 participants