ci: Prevent E2E timeouts on release changes#26846
Conversation
d9d3bf9 to
062e76c
Compare
Our CI was setup to compare each branch with `develop`, and run any tests that have changed since `develop` extra times to catch new flaky test regressions. Unfortunately this was happening even for PRs that do not target develop, resulting in massive lists of "changed" tests that ended up causing persistent test timeouts. The quality gate should only impact PRs that target `develop`. PRs that target other branches no longer repeat "changed" tests. This should fix release PR e2e test timeouts caused by excessive e2e test runs.
062e76c to
2a83a56
Compare
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #26846 +/- ##
========================================
Coverage 70.12% 70.12%
========================================
Files 1422 1422
Lines 49526 49526
Branches 13863 13863
========================================
Hits 34730 34730
Misses 14796 14796 ☔ View full report in Codecov by Sentry. |
Builds ready [2a83a56]
Page Load Metrics (1811 ± 101 ms)
Bundle size diffs
|
desi
left a comment
There was a problem hiding this comment.
So the gist is that rather than exclude master and RC we only target 'develop' correct?
Previously we would run this "get changed tests" script for all branches except Now we decide whether this script applies based upon the PR target / base ref, rather than the branch name itself. If a branch is targeting develop, we want this script to run (resulting in extra test runs for changed tests, to help prevent flakiness). |
danjm
left a comment
There was a problem hiding this comment.
Good catch! Solution looks good.
seaona
left a comment
There was a problem hiding this comment.
LGTM! Very nice catch and improvement 😍 thank you!
| // We're referencing the CIRCLE_PULL_REQUEST environment variable within the script rather than | ||
| // passing it in because this makes it easier to use Bash parameter expansion to extract the | ||
| // PR number from the URL. | ||
| const result = await exec(`gh pr view --json baseRefName "\${CIRCLE_PULL_REQUEST##*/}" --jq '.baseRefName'`); |
There was a problem hiding this comment.
I tried using the CIRCLE_PR_NUMBER environment variable first, but it doesn't appear to be present for our workflows for some reason, despite being documented.
Sadly there is no way to reference the base ref directly from CircleCI either. It's a highly requested feature apparently, but is not supported. But this works fine as a workaround.
|
Missing release label release-12.2.0 on PR. Adding release label release-12.2.0 on PR and removing other release labels(release-12.6.0), as PR was cherry-picked in branch 12.2.0. |



Description
Our CI was setup to compare each branch with
develop, and run any tests that have changed sincedevelopextra times to catch new flaky test regressions. Unfortunately this was happening even for PRs that do not target develop, resulting in massive lists of "changed" tests that ended up causing persistent test timeouts.The quality gate should only impact PRs that target
develop. PRs that target other branches no longer repeat "changed" tests. This should fix release PR e2e test timeouts caused by excessive e2e test runs.You can see an example of this problem occurring here: https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/98357/workflows/b61a16b5-acfd-411f-b82e-7a31706ca658/jobs/3660843
Notice that
/home/circleci/project/test/e2e/tests/request-queuing/ui.spec.jsappears 6 times in the full test list, as to every other "changed" test.Related issues
This quality gate was first introduced in #24556
Manual testing steps
The script can be run locally if you setup "fake" CircleCI environment variables to allow it to run properly. For example:
The CI run for this PR can be viewed as well: https://app.circleci.com/pipelines/github/MetaMask/metamask-extension/98369/workflows/e9de2170-a19e-433e-a83c-846eeb239842/jobs/3661034
Screenshots/Recordings
N/A
Pre-merge author checklist
Pre-merge reviewer checklist