Repository navigation
ripple: drop the 50% limit and always run only the affected unit tests - #344134
Merged
Merged
Conversation
`ripple plan` ran every unit test when the selected unit tests were more than `--max-share` (default 0.5) of the unit test work, so a change that can affect 60% of the unit tests ran all of them on macOS and Windows. Selection is now off only for a dependency reason (`Selection::run_all`): a `runEverything` file, a package or script of the test runners, a module that the runners use, or a module that does not parse. Otherwise the plan selects the files the change can affect, however many. `--max-share` is gone (passing it is an error), `select` is `sel.run_all.is_none()`, and the share stays in plan.json and in the reason as information. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused removal matches the intended behavior, preserves existing plan contracts and dependency safeguards, and has no unresolved findings.
No open issues 🎉
What changed in this PR
Removes Ripple’s cost-based cutoff so macOS and Windows CI use affected unit test selections regardless of their share of total test work.
Changes:
- Removes
--max-shareand the 50% fallback; dependency-based full-run safeguards remain. - Preserves
shareas informational output and leaves Linux full-test runs unchanged. - Updates CLI help and documentation to match the new behavior.
| File | Description |
|---|---|
build/ripple/src/main.rs |
Removes threshold parsing and makes selection depend only on run_all. |
build/ripple/README.md |
Documents unrestricted selection and removes the obsolete option. |
Review effort: Balanced
Alexandru Dima (alexdima)
marked this pull request as ready for review
October 25, 2026 13:39
Alexandru Dima (alexdima)
enabled auto-merge (squash)
October 25, 2026 14:27
Ladislau Szomoru (lszomoru)
approved these changes
Oct 25, 2026
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.
Follow-up to #342907.
What
ripple planhad a cost-based cutoff: when the selected unit tests were more than--max-share(default 0.5) of the unit test work, it reportedrunning every unit test: the change affects N% of the unit test work (limit 50%)and setselect: false, so macOS and Windows ran every unit test. This removes it, without a replacement threshold. A plan now either selects exactly the unit test files that a change can affect, however many, or runs every unit test for a dependency reason only (Selection::run_all): arunEverythingfile, a package or script of the test runners, a module that the runners use, or a module that does not parse. Linux still runs every unit test on every push.build/ripple/src/main.rs:--max-shareis gone from the usage, the option list and the parsing (passing it now fails withunknown option '--max-share'), and so are themax_shareparameter ofplan()and its reason.selectissel.run_all.is_none().sharestays inplan.jsonand in the reason of a selection, as information. rustfmt now packsOPTIONSonto two lines:"max-share"was its only element longer than rustfmt's threshold for short array elements (10 characters).build/ripple/README.md: the CI paragraph and theplancommand no longer mention the limit.pr.ymlnever passed--max-shareand needs no change: itsCheck ripplestep reads.reasononly forparse error (, and.selectand.unitfor a plan that selects nothing.What the limit cost
On the replay of the 708 first-parent commits of
mainfrom Oct 13 to 20 (the one in the README), 18 commits (2.5%) went over the limit. They would have selected 69.6% of the unit test work on average, and ran all of it. Without the limit, the macOS and Windows unit test work per commit drops from 9.8% to 9.0% of a full run on average, about 0.4 VM minutes per push: the unit test steps of a full run took 49.4 VM minutes on macOS and Windows in the last run of #344104, which ran every unit test.Open pull requests that read
plan.jsonNeither depends on the limit's reason text:
ripple/skip-browser-jobs) reads.reasononly forparse error (, and.selectand.unit. It rewrites the same README sentence and keeps "or when it affects more than half of the unit test work", so whichever of the two merges second has a one-line conflict there: drop that clause.ripple/recall-warning) reads.selectandunit.txt. The plans that went over the limit now select, so its recall check covers them too.Validation
cd build/ripple && cargo +nightly-2026-04-14 fmt && cargo test --release --locked && cargo build --release --locked: passed. rustfmt's only change is theOPTIONSlayout above; 72 tests passed; the release build has no warnings.decl > 0.5andrunAll == null:ripple plan --config build/ripple/vscode.jsonc --base <sha>^1 --head <sha>, with this branch's binary and with the one built from a383e08 (ci: run only the unit tests a change can affect on macOS and Windows #342907), which has the limit. This branch selects in all 18, exactly the replay'sdeclTestFiles, and both binaries list identical files (.unit). The replay predates ripple: count writes to pure globals as load-time effects #344104, but ripple: count writes to pure globals as load-time effects #344104 changes none of these selections: its own replay found all 708 commits identical ondeclTestFilesandrunAll. The shares match up to the rounding ofshareto 4 decimals inplan.json(largest difference 0.00005).The 18 commits
declTestFilesmainat a383e08select: true, 1,525 filesselect: false(limit 50%)select: true, 1,083 filesselect: false(limit 50%)select: true, 1,383 filesselect: false(limit 50%)select: true, 1,188 filesselect: false(limit 50%)select: true, 1,398 filesselect: false(limit 50%)select: true, 1,401 filesselect: false(limit 50%)select: true, 1,396 filesselect: false(limit 50%)select: true, 1,820 filesselect: false(limit 50%)select: true, 1,414 filesselect: false(limit 50%)select: true, 1,276 filesselect: false(limit 50%)select: true, 1,418 filesselect: false(limit 50%)select: true, 1,420 filesselect: false(limit 50%)select: true, 1,426 filesselect: false(limit 50%)select: true, 1,428 filesselect: false(limit 50%)select: true, 1,428 filesselect: false(limit 50%)select: true, 1,828 filesselect: false(limit 50%)select: true, 1,437 filesselect: false(limit 50%)select: true, 1,745 filesselect: false(limit 50%)select: false, with the replay'srunAllreason (12 test job definitions, 2 test runners, 1 transpiler, 1 runtime version).--out-dir,GITHUB_OUTPUTandGITHUB_STEP_SUMMARY:select=true, aunit.txtwith 1,820 files, and a job summary that lists them. TheCheck rippleexpressions ofpr.ymlon thatplan.json: no parse warning,selects-nothing=false.ripple plan --config vscode.jsonc --base HEAD --max-share 0.5:Error: unknown option '--max-share'.git grep -nE 'max-share|max_share|half of the unit test|limit 50|\(limit ' -- build/ripple .github test/unit build/lib: no matches.node --experimental-strip-types build/hygiene.ts build/ripple/src/main.rs build/ripple/README.md: passed (it checksmain.rs;README.mdis not eligible). The pre-commit hook passed too.build/ripple, its CI runs every unit test, and theRipplecheck builds, tests and plans with this branch.