ci(test): enforce coverage floors at current levels#2659
ci(test): enforce coverage floors at current levels#2659jordan-simonovski wants to merge 1 commit into
Conversation
Pin Jest coverageThreshold in the unit configs for app, common-utils and hdx-eval to just below each package's measured coverage (measured minus one, rounded down). Coverage can now only ratchet upwards: any decay below these floors fails the build, so the floors rise only when someone raises them deliberately. Also add --coverage to hdx-eval's ci:unit so its threshold is actually collected and enforced. Integration configs are left untouched. The API unit config is deferred to a follow-up until the API unit/int split (#2653) lands.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🟡 Tier 3 — StandardIntroduces new logic, modifies core functionality, or touches areas with non-trivial risk. Why this tier:
Review process: Full human review — logic, architecture, edge cases. Stats
|
Deep Review✅ No critical issues found. This is a test-infrastructure-only change (three 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (5): ce-correctness-reviewer, ce-testing-reviewer, ce-maintainability-reviewer, ce-project-standards-reviewer, ce-learnings-researcher. Testing gaps:
|
E2E Test Results✅ All tests passed • 239 passed • 3 skipped • 1614s
Tests ran across 4 shards in parallel. |
|
Thanks — no code changes here; the P2s are known/deferred:
|
|
Folded into #2654 (combined quality-gate floors PR) via cherry-pick — coverage floors + ESLint ceilings ship together as one 'metrics can only improve' gate. Closing to halve merge overhead. |
Jest already collects coverage but nothing gates on it, so coverage can decay unnoticed. This pins per-package coverage thresholds just below the current measured levels, so the floor can only rise — decay becomes a build failure.
What changed
coverageThreshold.global(statements/branches/functions/lines) to the unitjest.config.jsofpackages/app,packages/common-utils, andpackages/hdx-eval, each set to the measured value minus ~1 point.packages/hdx-eval'sci:unitgained--coverageso its threshold is actually collected.Key decisions
packages/apiis deferred — itsci:unitdoesn't exist until the API unit/integration split (ci: faster test feedback — split API tests, parallelise common-utils, shard integration #2653) merges; the API floor is a follow-up once that lands.packages/cliis skipped (a single test file — a threshold there would be theatre).Impact
collectCoverageFrom, so a brand-new entirely untested file doesn't lower the global percentage and won't trip the floor. Adding it later would re-baseline all thresholds; worth a tracked issue rather than expanding this PR.Implementation detail
Verified both directions:
make ci-unitpasses with the floors; temporarily settingstatements: 99in common-utils fails with a threshold error; reverted.