Repository navigation
test: tighten coverage gate thresholds to match actual 100% coverage - #411
hivecommons-hive[bot] wants to merge 2 commits into
Conversation
package.json's test:coverage thresholds (lines 99, statements 99, branches 97, functions 100) were looser than the repo's actual coverage (100% across all four metrics on every included file). Verified: deleting a single branch-covering test case (the colon-title quoting test in scripts/add-frontmatter.test.mjs) drops branch coverage to 99.09%/97.61%(add-frontmatter.mjs: 95.65%) — the old 97% branches threshold still passes (exit 0) with that regression in place, while the tightened 100% thresholds correctly fail the gate. No production or test code changed; this only raises the bar the existing gate already nearly meets. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
package.json's test:coverage thresholds (lines 99, statements 99, branches 97, functions 100) were looser than the repo's actual coverage, which is 100% across all four metrics on every included file. Verified the gap is real: temporarily removing the colon-title test case in scripts/add-frontmatter.test.mjs (reverted before this commit) dropped branch coverage to 99.09% overall / 95.65% in add-frontmatter.mjs, and the old 97% branches threshold still let 'npm run test:coverage' exit 0 with that regression in place, while the tightened 100% threshold correctly fails it. Adds scripts/coverage-thresholds.test.mjs, a regression test that reads package.json and asserts all four c8 threshold flags equal 100, so a future PR that loosens the gate again fails test:unit instead of merging silently. No production code changed. Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
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. Agent PRs are held at ACMM L3–L5; an Hive will keep the |
✅ Deploy Preview for cncf-techdocs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
eca24f8
ℹ️ Sentinel notice — informational; author is trusted (hive agent), merge is not blockedHive flagged this PR (author @hivecommons-hive[bot], head
Hive did not add the |
There was a problem hiding this comment.
Verified this locally at head eca24f8 — the change is correct and the PR body's claims check out.
What I ran:
npm run test:coverageat the PR head: coverage is genuinely 100% stmts/branch/func/line on every included file, and the tightened--lines 100 --statements 100 --branches 100 --functions 100gate passes (c8 table confirms, exit 0 for the coverage check itself).- The new guard test
scripts/coverage-thresholds.test.mjsis picked up by the existingscripts/**/*.test.mjsglob intest:unitand passes; its regex correctly extracts each of the four c8 flags frompackage.json(package.json:39).
One thing a maintainer should know before merging: test:unit currently exits 1 at this head, but the single failure is scripts/typecheck.test.mjs:11 hitting a pre-existing TS2339 in lib/docusaurusConfigPreprocessor.test.mts:15 — I reproduced the same failure on base commit 418adeb with this PR's diff absent, so it is base-branch breakage, not introduced here. Open PR #408 fixes exactly that regression; merging #408 first (or rebasing this afterward) makes this PR's suite fully green.
No production code changes, two-file diff, claims independently reproduced. Looks correct to me — ordinary sequencing after #408, nothing here needs a human decision beyond the normal merge.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
Test Improvement
package.json'stest:coveragec8 thresholds (--lines 99 --statements 99 --branches 97 --functions 100) were looser than the repo's actual coverage, which is 100% stmts/branch/func/line on every included file (confirmed by runningnpm run test:coverageat revision 418adeb). The slack means a future branch-coverage regression of up to ~3% could land without failing this gate — once #390 (test:unit wired into CI) lands, that slack becomes a silent blind spot in CI itself, not just locally.Verified the gap is real, not theoretical: temporarily removing the colon-title test case in
scripts/add-frontmatter.test.mjs(a regression simulation, reverted before commit) drops branch coverage to 99.09% overall / 97.61% inscripts// 95.65% inadd-frontmatter.mjs. With the old 97% branches threshold,npm run test:coveragestill exits 0 — the regression is invisible. With the tightened 100% threshold in this PR, the same run exits 1 and reportsCoverage for branches (99.09%) does not meet global threshold (100%).Adds
scripts/coverage-thresholds.test.mjs, a small regression test that readspackage.jsonand asserts all four c8 threshold flags equal 100, so a future PR that loosens the gate again failstest:unitinstead of merging silently. No production code changed.Related Issue
Refs #390 (needs-human: that issue's fix requires a .github/workflows/ change this lane's contributor-tier token cannot push; this PR is a complementary, pushable hardening of the coverage gate itself and does not close #390)
Filed by quality agent (hold-gated mode). Human review required.
— hive: agent=quality backend=copilot model=claude-opus-4-6 copilot=1.0.88