-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
chore: adds quality gate for rerunning e2e spec files that are new or have been modified #24556
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. |
…logic is working properly in failing tests
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #24556 +/- ##
========================================
Coverage 69.57% 69.57%
========================================
Files 1360 1360
Lines 48172 48172
Branches 13296 13296
========================================
Hits 33513 33513
Misses 14659 14659 ☔ View full report in Codecov by Sentry. |
Builds ready [71bbf50]
Page Load Metrics (623 ± 464 ms)
Bundle size diffs
|
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!
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Builds ready [9b1c7cc]
Page Load Metrics (140 ± 187 ms)
Bundle size diffs
|
…suggestion Co-authored-by: Mark Stacey <markjstacey@gmail.com>
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!
Quality Gate passedIssues Measures |
Builds ready [07e81d8]
Page Load Metrics (186 ± 204 ms)
Bundle size diffs
|
Description
This PR adds a quality gate for new or modified e2e spec files. Whenever there is a PR which modifies or changes a test, this will be run more times, in order to prevent introducing a flakiness accidentally. It is done as follows:
git diff
and using these 2 filters:file.filename.startsWith('test/e2e/') &&
file.filename.endsWith('.spec.js') || file.filename.endsWith('.spec.ts')
--retry-until-failure
I just leveraged this into thefor
loop for each test, and if that testcase was identified as new/modified, the flag is added so the new tests fail fast without retrialsIncremental git fetch depth within shallow clone
We use git fetch with incremental depth as @danjm suggested. The ci environment uses a shallow clone, meaning we won't be able to succeed just by using git diff as it won't find the merge base. For fixing that, we start with a git fetch depth of 1, and keep incrementing the depth (1, 10, 100) it the error is
no merge base
up until 100. If the git diff still fails, we then do a full git fetch with theunshallow
flag.New ci Job
The git diff is done in a new ci job which runs at the beginning in parallel of prep-deps.
Related issues
Fixes: #24009
Manual testing steps
Screenshots/Recordings
=============================================== [UPDATE with the new code changes]
new-tests-ci.mp4
https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/89277/workflows/7fce0a2e-773f-46da-8ab9-1dbec7992b58/jobs/3297267/parallel-runs/10?filterBy=ALL
🟢 Case 2: A test has changed, but it has a mistake in the code (intentionally to simulate a flaky test) -> it fails immediately and there are no more retries. The rest of the tests, are retried if they failed as usual
🟢 Case 3: A PR has no test spec files changed -> nothing different happens
ci run: check current ci
Pre-merge author checklist
Pre-merge reviewer checklist