fix: Skip passed e2e tests on re-run to reduce CI time#24263
Merged
Conversation
e2e/specs/confirmations-redesigned/transactions/send-max-transfer.spec.ts
Outdated
Show resolved
Hide resolved
e2e/specs/confirmations-redesigned/transactions/send-max-transfer.spec.ts
Outdated
Show resolved
Hide resolved
Contributor
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsThe PR introduces E2E test re-run optimization - a CI/CD infrastructure improvement that allows re-runs to skip passed tests and only re-run failed/not-executed tests. Key changes:
These are purely CI/CD infrastructure changes with no application code modifications:
Running E2E tests would not validate these changes because:
This is a low-risk change as it's additive infrastructure that doesn't modify existing test execution for first runs. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Similar what we've done in the extension here, this PR implements same approach into mobile repository.
For more information please see thread here.
When an E2E test fails in CI and developer triggers a re-run, all tests in that chunk are executed again, not just the failed ones. This leads to:
For example, with 20 parallel chunks each running ~15 tests, a single flaky test failure triggers a re-run of the entire chunk (~15 tests) instead of just the 1 failed test.
For solution; implement selective test re-runs that automatically detect when a job is being re-run and skip tests that already passed.
Validation of PR:
Intentionally broke tests here: c8f029f
On attempt1 it failed but other tests passed: https://github.com/MetaMask/metamask-mobile/actions/runs/20751876785/attempts/1?pr=24263
On attempt2 it only run failed test and skipped already passed tests: https://github.com/MetaMask/metamask-mobile/actions/runs/20751876785/attempts/2?pr=24263
Logs from attempt 2:
Changelog
CHANGELOG entry:
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Reduces CI time by re-running only failed or not-executed E2E specs on job re-runs and preserving pass/fail history.
e2e-extract-test-results.mjs(parses jest-junit XML to identify passed/failed/executed specs) ande2e-merge-test-results.mjs(merges prior XML results for specs not executed this attempt)e2e-split-tags-shards.mjsto: on re-runs, filter shard files using extracted results; skip if all passed; limit flakiness duplication to first attemptrun-e2e-workflow.ymlto: download previous results on re-runs, passRUN_ATTEMPT/PREVIOUS_RESULTS_PATHenvs, add debug listing, and merge previous results into currente2e/reportsbefore uploading artifactsWritten by Cursor Bugbot for commit e5cd5c7. This will update automatically on new commits. Configure here.