Repository navigation
test(coverage): give the tests/tools/ harness a floor of its own - #1207
Merged
Merged
Conversation
`tests/tools/` is the third SOURCE_ROOTS entry, so --require-source-files insists every module in it be measured -- and then no ratio gate scored it. --check-source, --check-source-regions and --check-source-file-regions are all built from isSourceFile(), which drops everything under tests/, so the only floor over the harness was --check-regions, an all-files aggregate over ~8900 regions that the suite's own test files dominate. The measuring apparatus was required to be present and held to no standard, while tests/tools/e2e-coverage-report.mjs sat at 93.65% regions. Report `harness files` as its own row beside `src files`, built from the same SOURCE_ROOTS entry --require-source-files walks (isHarnessFile() is derived from SOURCE_ROOTS rather than restating the directory, so the row and the file-set floor cannot come to name different trees). Add --check-harness, --check-harness-regions and --check-harness-file-regions: the same three shapes as the source gates, with the same refusal to pass vacuously over a run that recorded no harness file, and the per-file failure naming the file, its ratio and its uncovered region start lines. It stays a separate row rather than widening `src files`, for the reason isSourceFile() already gives: the harness is not code this repository ships, and merging the two would let a harness gap be paid for out of src/'s slack -- the averaging --check-source-file-regions exists to stop. `src files` and `harness files` now share one accumulator, so a change to how one row is built cannot quietly stop applying to the other. Floors, measured on the suite this commit ships (harness files 100.00% lines / 97.95% regions, 3522/3522 lines, 1384/1413 regions; lowest harness file tests/tools/e2e-coverage-report.mjs at 93.65%): --check-harness 100, --check-harness-regions 97, --check-harness-file-regions 93. Recorded in tests/coverage-gate-thresholds.test.mjs, whose "every threshold the reporter supports is actually gated" test requires the gate script to pass all three. CONTRIBUTING.md and AGENTS.md state the new floors beside the existing ones. The four-number phrase tests/docs-threshold-parity.test.mjs pins is left exactly as it was; the harness floors are stated in a clause of their own. Closes #1192 Signed-off-by: quality <quality@hive.kubestellar.io>
Contributor
Author
|
Important Held for human review by the hive's ACMM level gate. This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Non-outreach agents are held at ACMM L3–L5; the Hive will keep the |
This was referenced Oct 8, 2026
This was referenced Oct 9, 2026
Closed
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.
Test Improvement
tests/tools/is the thirdSOURCE_ROOTSentry(
tests/tools/coverage-report.mjs:91), so--require-source-filesinsistsevery module in it be measured — and then no ratio gate scored what the
measurement said.
--check-source,--check-source-regionsand--check-source-file-regionsare all built fromisSourceFile(), whichclassifies everything under
tests/as non-source, so the harness enterednone of their ratios. The only floor left over it was
--check-regions, anall-files aggregate over ~8900 regions that the suite's own test files
dominate:
tests/tools/e2e-coverage-report.mjssits at 93.65% regions andnothing failed.
That tree is where the coverage reporters, the Playwright coverage fixture,
the data-overlay loader and the JSX/DOM harness live, so a gap there is a gap
in the instrument every other gate reads.
What this changes
tests/tools/coverage-report.mjsreports aharness filesrow besidesrc filesandall files, built from the sameSOURCE_ROOTSentry--require-source-filesalready walks —isHarnessFile()is derived fromSOURCE_ROOTSrather than restating the directory, so the row and thefile-set floor cannot come to name different trees.
same refusal to pass vacuously over a run that recorded no harness file:
--check-harness,--check-harness-regions,--check-harness-file-regions.The per-file failure names the file, its ratio and its uncovered region start
lines, the way
--check-source-file-regionsdoes.src filesandharness filesnow share one accumulator, so a change to howone row is built cannot quietly stop applying to the other.
package.json'stest:unit:coverage:checkpasses all three — required bythe existing "every threshold the reporter supports is actually gated"
test — and
tests/coverage-gate-thresholds.test.mjsrecords the matchingfloors.
tests/coverage-report-harness-floor.test.mjs(new, 10 tests) covers thepredicate, the row, each floor failing on a real run, the per-file message
shape, and all three vacuous-pass guards.
tests/docs-threshold-parity.test.mjspins is left exactly as it was;the harness floors are stated in a clause of their own.
Floors, and how they were set
Measured locally at
593b9feon the suite this PR ships(
npm run test:unit:coverage:check, node v26.10.0,TZ=UTC):Lowest harness file:
tests/tools/e2e-coverage-report.mjsat 93.65% regions.Floors are set from that and rounded down:
--check-harness 100,--check-harness-regions 97,--check-harness-file-regions 93.Verified locally:
npm run test:unit:coverage:checkexits 0,npm run checkexits 0, and the full
node --testsuite is 2099/2099 green.Scope and overlap
Files claimed:
tests/tools/coverage-report.mjs(thereport()summary rows,the
PERCENT_FLAGStable and the gate block inmain()),package.json'sscripts.test:unit:coverage:check,tests/coverage-gate-thresholds.test.mjs, the newtests/coverage-report-harness-floor.test.mjs, and the coverage-thresholdprose in
CONTRIBUTING.md/AGENTS.md.origin/mainat593b9fe, after it.scripts/lib/svg-active-content.mjsCSS-escape quote pairing) and test(e2e): give each fixture overlay directory its own coverage build #1203 (
tests/tools/e2e-coverage-builds.mjsand the e2e fixture overlays). test(e2e): give each fixture overlay directory its own coverage build #1203 touches
package.jsonandCONTRIBUTING.md, but its edits are to thebuild:e2e:coverage:*scriptsand the e2e recipe, not the coverage gate string or the threshold prose.
.github/workflows/ci.yml:40already runsnpm run test:unit:coverage:check.Related Issue
Closes #1192
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88