Background
store/postgres.rs is excluded from the coverage-check gate
(Makefile) because its 27 tests are
#[ignore]d — they require a live DATABASE_URL that the coverage
job doesn't provide. That exclusion currently covers the whole file
(~1000 lines), not just the untestable parts, so future regressions
in the ~700 lines of pre-existing production code (connection setup,
CRUD, row conversion, schema validation) are invisible to the 95%
line-coverage threshold.
Flagged by praxis-bot on #570: #570 (comment)
#739 already added a postgres.yaml CI workflow that runs the
ignored postgres unit/integration tests against a real service
container, but that run is separate from make coverage-check and
isn't instrumented for coverage.
Proposed approach
cargo-llvm-cov supports accumulating coverage across multiple test
invocations via --no-report, then producing one merged report:
cargo llvm-cov clean --workspace
cargo llvm-cov --no-report --workspace ... # normal suite
DATABASE_URL=... cargo llvm-cov --no-report -p praxis-ai-apis store::tests::pg_ -- --ignored # postgres unit tests
cargo llvm-cov report --json --output-path coverage.json # merged report
This would let coverage-check include store/postgres.rs without
the blanket exclusion. It requires:
- Adding a postgres service container to
.github/workflows/coverage.yaml
(mirroring the one already in postgres.yaml).
- Splitting the
coverage-check Makefile target into the --no-report
accumulation passes above plus a final merged report.
- Removing the
store/postgres\.rs exclusion from the
--ignore-filename-regex in Makefile.
Trade-off to weigh
This makes the coverage gate depend on a live database for every PR,
adding container startup time to a job that currently runs without
external services.
Background
store/postgres.rsis excluded from thecoverage-checkgate(Makefile) because its 27 tests are
#[ignore]d — they require a liveDATABASE_URLthat the coveragejob doesn't provide. That exclusion currently covers the whole file
(~1000 lines), not just the untestable parts, so future regressions
in the ~700 lines of pre-existing production code (connection setup,
CRUD, row conversion, schema validation) are invisible to the 95%
line-coverage threshold.
Flagged by praxis-bot on #570: #570 (comment)
#739 already added a
postgres.yamlCI workflow that runs theignored postgres unit/integration tests against a real service
container, but that run is separate from
make coverage-checkandisn't instrumented for coverage.
Proposed approach
cargo-llvm-covsupports accumulating coverage across multiple testinvocations via
--no-report, then producing one merged report:This would let
coverage-checkincludestore/postgres.rswithoutthe blanket exclusion. It requires:
.github/workflows/coverage.yaml(mirroring the one already in
postgres.yaml).coverage-checkMakefile target into the--no-reportaccumulation passes above plus a final merged report.
store/postgres\.rsexclusion from the--ignore-filename-regexinMakefile.Trade-off to weigh
This makes the coverage gate depend on a live database for every PR,
adding container startup time to a job that currently runs without
external services.