Repository navigation
ci: skip the macOS and Windows unit test jobs when the plan selects nothing - #344105
Merged
Merged
Conversation
…othing When the unit test plan selects no file, the macOS and Windows unit test jobs still checked out, restored node_modules, transpiled and set up Electron or Playwright before skipping their test steps. Detect Changes now reports whether the plan of a working ripple selects nothing (selects-nothing in the Check ripple step), and its selected-unit-tests output skips those four jobs, which run nothing but unit tests. A missing, failed or run-everything plan still runs them, and Linux keeps running every unit test. required-checks accepts the skips through the same output. Co-authored-by: Copilot <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The scoped changes keep job gating and required-check reporting consistent while preserving failure fallbacks and Linux coverage.
No open issues 🎉
What changed in this PR
This follow-up to #342907 avoids unnecessary setup by skipping the four macOS and Windows unit test jobs when a successful ripple plan selects no tests.
Changes:
- Adds
selected-unit-testsgating while preserving failure fallbacks and Linux’s existing full-suite behavior. - Aligns the four job conditions with required-check reporting.
- Adds workflow regression assertions and documents the job-level skip.
No actionable findings remain.
| File | Description |
|---|---|
build/ripple/README.md |
Documents skipping jobs when the plan selects no tests. |
build/lib/test/detectChanges.test.ts |
Checks the output expression and the exact jobs eligible for plan-based skipping. |
.github/workflows/pr.yml |
Detects empty successful plans and updates job gating, required checks, and summary text. |
Review effort: Balanced
Alexandru Dima (alexdima)
marked this pull request as ready for review
October 25, 2026 08:22
Alexandru Dima (alexdima)
enabled auto-merge (squash)
October 25, 2026 08:22
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.
What
Follow-up to #342907. When the unit test plan selects no file, the four macOS and Windows unit test jobs (
macOS (run) / Electron-Unit,macOS (unit) / Browser,Windows (run) / Electron-Unit,Windows (unit) / Browser) still check out, restore node_modules, transpile and set up Electron or Playwright, and only then skip their test steps: 8.9 VM minutes per push that selects nothing, for nothing (see Savings). This skips those jobs instead.How
Check ripplestep ofDetect Changesnow also reportsselects-nothing=truewhen the plan of a working ripple selects no file: the ripple build did not fail, the plan step succeeded, andplan.jsonhasselect: trueand an emptyunitlist. A missing, failed or run-everything plan (select: false) reportsfalse.Detect Changesoutput,selected-unit-tests, isunit-tests == 'true' && selects-nothing != 'true', so a missing value runs the jobs.selected-unit-testsinstead ofunit-testsin theirif, and so do their parts inrequired-checks, which accepts a skipped job only when change detection succeeded and the job's output is'false'. The Linux unit test jobs keepunit-testsand run every unit test.detectChanges.test.tschecks the new output's expression and that exactly the jobs that passunit_test_selection: true(the four above, never Linux) skip through it. The existing test checks the shape of theirif.build/ripple/README.mdmention the skip.This pull request changes
.github/workflows/pr.yml, which is inrunEverything, so its own CI runs every unit test and cannot show the skip. The sibling live test #344098 shows what the four jobs do today on an empty plan.Savings
The "selects nothing" live test (#344098, run 40172614560, see its result) measured what the four jobs cost on a push whose plan selected nothing. That is what this change saves on such pushes:
macOS (run) / Electron-UnitmacOS (unit) / BrowserWindows (run) / Electron-UnitWindows (unit) / Browser516 s of that is setup before the test steps, and restoring the node_modules cache alone takes 55–62% of each job. The time outside the test steps of the same jobs in 40 recent runs agrees (median 7.6, mean 9.1 minutes per push).
unit-tests: false) already skip these jobs, and they were 2 of 120 recent runs. If the 17% includes them, the saving is still at least 1.35 minutes per push.pr.ymlran about 2,500 times for pull requests. 240 runs a day completed, 91 were cancelled by a newer push, and 34 waited for approval and ran nothing. That makes about 330 to 360 VM minutes a day (5.5 to 6 hours) for the completed runs. Counting cancelled runs whose jobs had already set up, it's up to 500. Weekdays see about 1.2 times the daily average.macos-26-xlargerunners, which bill each job by the started minute: 2 billed minutes per job here, so 4 per push that selects nothing (about 160 a day). The Windows minutes are 1ES pool VM time, not counting provisioning.Validation
cd build && node --test lib/test/detectChanges.test.ts lib/test/agentHostTestSelection.test.ts lib/test/detectMissingCaches.test.ts: passed, 23 tests in 4 suites. Three mutations ofpr.ymleach fail it: gating a Linux unit test job by the plan, letting a missingselects-nothingskip, and leaving a macOS job'sifonunit-tests.actionlint 1.7.12 with shellcheck 0.11.0 on
pr.yml,pr-darwin-test.ymlandpr-win32-test.yml: same findings asmain, the 6 self-hosted runner label warnings and 3 SC2086 infos in steps this change does not touch.Check ripplewrites its three outputs in one redirect group, as shellcheck asks (SC2129).node --experimental-strip-types build/hygiene.ts .github/workflows/pr.yml build/lib/test/detectChanges.test.ts build/ripple/README.md: no hygiene-eligible files. Hygiene's filters cover none of these files:.github/**is outside its scope,build/lib/**is excluded from its indentation, copyright and formatting checks, and so is Markdown. The pre-commit hygiene hook passed.npm run eslint -- build/lib/test/detectChanges.test.ts: passed.Local simulation. ripple built from this branch planned real commits on top of
main. The harness ran the actualPlan unit tests,Check rippleandrequired-checksscripts from the editedpr.ymlwithbash -eo pipefail, and the realdetect.tschange detectors. It then evaluated the workflow's own expressions (job outputs, job and stepifconditions,hashFiles) with GitHub's comparison semantics:selects-nothingselected-unit-testsMoveCaretCommand.getEditOperations)falsetruestrings.ts)truefalsemain: run and skip every test step)unit-tests: false)truefalsemainmainscripts/test.sh)falsetruefalsetruefalsetrueAgainst
main'spr.yml, the same scenarios differ only in the emptysrcselection row.required-checkslogsmacos-electron-unit-tests was skipped because the changes cannot affect it (selected-unit-tests: false).CI of this pull request (run 40174651599): passed.
Detect Changesplannedrunning every unit test: test job definition (.github/workflows/pr.yml)and uploaded no plan.Check rippleran the new script (BUILD: skipped,PLAN: success) without a warning. The four macOS and Windows unit test jobs ran every unit test and passed (macOS Electron-Unit 15.9 min, Windows Electron-Unit 20.3 min), and so did the requiredmacOSandWindowsElectron-UnitandBrowserchecks. TheRipplecheck ran because this changesbuild/ripple/README.md, and passed.Two theoretical cases still run the four jobs with every test step skipped, as on
main. One is a ripple that writes an empty plan and then fails. The other is a plan that succeeds although the ripple build step failed (which leaves no binary in practice). In both,Upload unit test planuploads the plan because it only checksselect. This change leaves that as is (selects-nothingisfalsein both), but checkingsteps.plan.outcome == 'success'there would close the first case.