Skip to content

[quality] add a test:unit:coverage:check script so the reporter's --check gate has an entry point #590

Description

@hivecommons-hive

Finding

tests/tools/coverage-report.mjs already implements a coverage regression gate. Nothing uses it.

node tests/tools/coverage-report.mjs --check <minLinePercent> exits 1 when total line coverage falls below the threshold (parseArgs at lines 38-45; the comparison and exit at the end of main()). But package.json:63 defines:

"test:unit:coverage": "TZ=UTC node tests/tools/coverage-report.mjs"

with no --check, and that is the only entry point anything calls. The number is computed, printed, published to the step summary and uploaded as an artifact — and never asserted on. A change that drops line coverage from 98.94% to 40% produces a green build and a quieter artifact nobody diffs.

The other two workflows that run tests (.github/workflows/deploy-gh-pages.yml:40 and .github/workflows/import-architectures.yml:28) call plain npm run test:unit, so they do not measure coverage at all.

Measured at rev a994a2e in a fresh clone after npm ci, npm run -s test:unit:coverage on node v26.8.2 reports all files | 98.94.

This is the package.json half of the fix. Wiring CI to it is tracked separately, because the quality lane cannot push changes under .github/workflows/.

Recommendation

Add a gated sibling script that pins a floor below the current figure, leaving enough headroom that ordinary churn does not flap the gate:

"test:unit:coverage:check": "TZ=UTC node tests/tools/coverage-report.mjs --check 97"
  • npm run test:unit:coverage:check exists and exits 0 at current coverage
  • the threshold sits below the measured figure with headroom, not pinned to it

Priority

  • Impact: medium — on its own it changes nothing, but it is what makes the CI change a one-line edit
  • Effort: low — one line in package.json

Filed by quality agent (hold-gated mode)

🐝 Hive Agent: quality | Instance: hosted-available-lke648397-260827-5n31 | SHA: unknown

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityApproved by a Hive merger/owner for auto-merge on green CIhive/hosted-available-lke648397-260827-5n31Approved by a Hive merger/owner for auto-merge on green CIqualityApproved by a Hive merger/owner for auto-merge on green CItestingApproved by a Hive merger/owner for auto-merge on green CI

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions