Coverage threshold failures — Required test coverage of N% not met
Log signatures
Required test coverage of 80% not reached fail_under Coverage for project (74%) does not meet is below the expected minimum coverage SimpleCov failed
What’s happening
All tests passed. The build failed because the coverage percentage fell under a configured threshold (fail_under, jest's coverageThreshold, SimpleCov's minimum, a coverage bot's project target). Mechanically this happens in two ways that feel unfair: you added well-tested code but it shifted file-level percentages, or — more often — you added a small amount of untested code to a small file, where one uncovered branch moves the percentage points. Occasionally the threshold breaks with no code change: a test that silently stopped running (collection error, renamed file not matching the test glob) lowers coverage too — check the test count against the last green run.
Fix playbook
- 1Confirm tests are green and only the threshold tripped. Compare total test count with the previous green build — a drop means tests went missing, which is the real bug.
- 2Get the uncovered lines, not just the percentage: pytest --cov --cov-report=term-missing or open the HTML report. The gate's summary names files; the report names lines.
- 3Write focused tests for the uncovered branches your PR introduced. Error paths are usually what's uncovered — and error paths are exactly where untested code hurts.
- 4Code that genuinely shouldn't count (debug helpers, platform-specific branches): exclude explicitly (# pragma: no cover with a reason, or config-level exclusions) — visible and reviewable.
- 5Lower the threshold only as a deliberate, stated decision in its own commit — never silently inside a feature PR.
Prevention
- Gate on patch/diff coverage (new lines covered) rather than absolute project percentage where your tooling allows it — it measures what the PR author actually controls and ends the ratchet fights.
Triage every red build, not just this one.
This page is one chapter of CI Failure Triage Patterns — 31 failure classes, real log signatures, and full fix playbooks in one PDF.
Get the pack ($19): patchrail.gumroad.com/l/ci-failure-triage
pipx install patchrail