Repository navigation
ci: gate coverage, test on Node 26, and run the pack test on Node 20.19 - #184
Merged
Merged
Conversation
Coverage of src/ and action/ was neither measured nor enforced. pnpm test:coverage now measures it with @vitest/coverage-istanbul, with thresholds at today's level rounded down (lines 94, branches 84, functions 93, statements 91), in one CI job on Node 24 that also writes the totals to the job summary. pnpm test and the other test jobs run without it. Istanbul rather than v8: v8 counts every block V8 runs, the TypeScript compiler's included, and made the tests that build a program about six times slower on CI, past the 30 s test timeout. The test matrix adds Node 26, which becomes LTS on 2026-10-28. The Node 20.19 job, which ran only the smoke test and one check, now also runs both pack test scripts there, with node, since pnpm needs a newer Node.
dgesteves
force-pushed
the
fix/os2-55-ci-gates
branch
from
October 16, 2026 09:52
3a96a52 to
ff968c0
Compare
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.
Roadmap item: OS2-55 (findings os-ci-release/no-coverage-gate and os-ci-release/node-matrix).
What was wrong
devDependencies, nocoverageblock invitest.config.ts, and nothing in.github/(git grep -n coverage package.json vitest.config.ts .github/matched nothing on main 5c6277f).check, but not the pack test, althoughpackage.jsondeclaresnode >=20.19.What changed
@vitest/coverage-istanbul5.0.3, the same version asvitest. It uses the same^5.0.3range, so Dependabot's dev-dependencies group moves them together.pnpm test:coveragerunsvitest run --coverage.vitest.config.ts: acoverageblock with the Istanbul provider oversrc/**andaction/**, thetextandjson-summaryreporters, and thresholds at today's level rounded down: lines 94, branches 84, functions 93, statements 91.pnpm testdoesn't measure coverage, so it is as fast as before.ci.yml:Coveragejob (Ubuntu, Node 24) runspnpm test:coverage, then writes the totals to the job summary. The summary step runs even when a threshold fails (if: ${{ !cancelled() }}), and says there is no report when the tests failed first. The other test jobs still runpnpm test.node: [22, 24, 26]. setup-node installed v26.12.0.node scripts/pack-test.mjsandnode scripts/pack-test-eslint8.mjsafter switching to 20.19 (v20.19.6 on CI). They run withnode, notpnpm pack-test, because pnpm 11.6.0 needs Node >=22.13.Where this differs from the findings' proposal
@vitest/coverage-v8, as proposed. On CI its Coverage job took 9m35s, against 2m26s for Test (Node 24) in the same run, and it failed on a 30 s test timeout (test/workspace.test.ts, "records one baseline at the root…"). v8 counts every block V8 runs, the TypeScript compiler's included, so the tests that build a TypeScript program slowed down most: on CI,test/cli.test.tswent from 31.8 s to 182.1 s,test/workspace.test.tsfrom 13.3 s to 83.7 s andtest/baseline.test.tsfrom 12.9 s to 79.8 s. Istanbul instruments onlysrc/andaction/. Locally, with 4 workers like a CI runner, the suite took 41.6 s without coverage, 72.0 s with Istanbul and 185.6 s with v8 (machine load between 7 and 20). Fortest/cli.test.tsalone: 11.9 s, 12.6 s and 95.6 s. Both providers give the same statements, functions and lines. They differ on branches (84.89% with Istanbul, 85.37% with v8), so the branch threshold is 84.Coverage today
pnpm test:coveragesrc/action/CI minutes
From this PR's run 38883460129, as runner time per CI run:
That adds about 7.4 minutes of runner time per run (about 9 minutes billed with per-job rounding). Wall-clock time stays the same: Coverage (3m39s) finishes before the Windows and macOS test jobs (4m48s and 4m32s) and the corpus job (7m33s).
How it was tested
test/ci-gates.test.ts(9 tests). On main, all 9 fail. On this branch, all 9 pass. It checks:src/**andaction/**, off unless asked for,json-summary, and all four thresholds;vitestrange and the installedvitestversion;coveragejob measures coverage, on Ubuntu and Node 24, and thattestandosstill runpnpm test;pnpm test:coverageand also when a threshold fails;pnpmafter switching, and runs both scripts ofpnpm pack-testin order.pnpm install --frozen-lockfile --prefer-offline,pnpm format:check,pnpm lint,pnpm typecheck,pnpm test(1023 passed, 3 skipped, 30.0 s) andpnpm build(no change toschema.json) all pass.pnpm test:coverageexits 0 (34.6 s).vitest run --coverage test/sarif.test.tsexits 1 withERROR: Coverage for lines (35.58%) does not meet global threshold (94%), and still writescoverage/coverage-summary.json. The summary step's script, run on that file, printed the table.pnpm buildon 24: all exit 0.Not in this PR
CONTRIBUTING.mdline 24 still says the tests run "on Node 22 and 24 (Linux)", and doesn't mentionpnpm test:coverage. X2-28 editsCONTRIBUTING.mdin the same wave, so this line is a follow-up after X2-28 merges: "on Node 22, 24 and 26 (Linux)", plus apnpm test:coverageline.mainare still "Lint, typecheck, build", "Test (Node 22)" and "Test (Node 24)". Making "Coverage" or "Test (Node 26)" required is a ruleset change for the owner.pnpm-lock.yamlchanges for the new dev dependency. No other wave 3 onsystem item lists the lockfile.