Repository navigation
ci(acceptance): Run 5 shards for frontend-only changes too - #131271
Closed
sentry-junior[bot] wants to merge 2 commits into
Closed
sentry-junior[bot] wants to merge 2 commits into
sentry-junior[bot] wants to merge 2 commits into
Conversation
Frontend-only runs used 10 shards. Each shard spends about 2 minutes on setup, so the extra 5 shards cost about 13 runner-minutes per run and saved only about half a minute of wall time. Refs DI-2876 Co-Authored-By: Burak Yigit Kaya <[email protected]>
joshuarli
added a commit
that referenced
this pull request
Nov 16, 2026
The acceptance workflow runs on almost every pull request and costs a lot of runner time. This change makes pull requests run only the acceptance tests their changes can reach. Pushes to master still run everything, so anything the selector misses shows up on master and we improve the selector from there. Refs DI-2876 A new `select-tests` job decides what to run. It follows backend.yml's `select-tests`: - Changed files come from `parse-pr-files.py`, piped from `gh api` exactly as backend.yml does it. - The `Trigger: Override Selective Testing` label turns selection off through the same `skip_selective_testing` output. - The selector writes the same kind of file for `SELECTED_TESTS_FILE`. What it selects: - Changes to the workflow, harness, settings, dependencies, build config or templates run everything. So do files the selector doesn't recognize. - Python under `src/` maps to tests through per-test coverage. A new daily scheduled run of this workflow, which can also be started by hand, records it. Until the first run, Python changes run everything. - Frontend files map to tests through a static import graph and a page map kept by hand. Changes to the shared app shell run everything. If selection fails, everything runs. If nothing is selected, the acceptance jobs are skipped and the required `Acceptance` status still succeeds. Shared with backend selection, in the new `selected_tests_common.py`: - the Python files that always run the whole suite, moved from `compute-sentry-selected-tests.py` - matching files against those triggers - the per-test coverage query The backend selector's behavior doesn't change. Only acceptance has the frontend import graph, the page map, and the app shell rules. The daily run combines the shards' coverage only when every shard passed, then saves it with `actions/cache`. Pull requests restore the newest copy, so they need no artifact lookup or extra permissions. Two lines of inline shell stay: - The existing run step gains one line that appends the coverage flags. - `uvx coverage combine` is one call. Coverage isn't in the stdlib, and that job doesn't have the sentry virtualenv. Known gaps: Python code that only runs at import time, imports the frontend graph can't parse, and pages that are missing from the page map. #131271 edits the same matrix lines; whichever lands second keeps both behaviors. With #131264, merge queue runs still run everything. <!-- junior-request-attribution:start --> via @joshuarli. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:agent%3A1715dc6ab4670d38b8ce3142b22c1d71 --> -- [View Session](https://junior-prod.sentry.dev/conversations/agent%3A1715dc6ab4670d38b8ce3142b22c1d71) [[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A1715dc6ab4670d38b8ce3142b22c1d71/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Joshua Li <[email protected]>
Member
|
needs to be revisited after #131325 soaks for a bit |
…shards # Conflicts: # .github/workflows/acceptance.yml
Contributor
Author
|
Makes sense, I'll keep this as a draft until #131325 has had time to soak. I merged master into this branch. The new version keeps the shard count from |
This branch was successfully deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Acceptance now always runs 5 shards. Frontend-only changes used to get 10.
Each shard spends about 2m on setup (devservices, the venv, and webpack) before it runs any tests, and per-shard xdist overhead grows the total test time as well. Doubling the shard count doubles the runner time and saves little wall time:
Master shows the same pattern: 37 vs 23 runner-minutes, with wall time 4.8m vs 5.5m.
Trade-off: frontend-only runs save about 13 runner-minutes each, and those are about two thirds of acceptance PR runs. Their wall time grows by about 0.5m, which puts Acceptance roughly level with
Frontend(p50 4.5m, p90 5.0m) instead of ahead of it. The 10-shard split was added when setup took about 2.5m and the suite was slower. Open question: is +0.5m on frontend-only PRs acceptable for this saving?Refs DI-2876
via @BYK.
--
View Session [Sentry]