Saltar a contenido

Python Backend Coverage Gate

The backend coverage gate builds on the existing coverage command from #216:

npm run test:py:coverage

The gate is configured in pytest.ini with --cov-fail-under=50. The current baseline on 2026-05-26 is 52% total coverage, so 50% gives a small buffer for unrelated backend work while preventing large regressions from merging.

Coverage output must keep --cov-report=term-missing so CI and local runs show the exact missing lines. The run also writes coverage.xml for CI artifact upload.

No new coverage exclusions are added for this gate. The coverage command still uses the #216 pytest ignores for fixture-dependent validation modules that need large external datasets or real patient fixture mounts. Future exclusions should be limited to generated code, migrations, fixtures, or legacy reference code and must state that reason in the same config or doc change.

Next ratchet target: raise the gate to 55% after the critical backend modules stay above that level in CI for a normal development cycle.