Repository navigation
ci(coverage): instrument the PostgreSQL integration tests - #431
Merged
Merged
Conversation
The seven PostgreSQL integration tests are gated with `#![cfg(not(feature = "test-helpers"))]`, and the workspace coverage run enables `test-helpers` through marreq-server/marreq-cloud, so they compile out of it. CI ran them earlier with plain `cargo test`, which is not instrumented, so the real `repository/diesel_repo` layer read as ~5% covered even though CI exercises it. Run them as instrumented `cargo cov --no-report -p marreq-core --test ...` builds after a single `cargo cov clean --workspace`, and drop the clean from the report step so it no longer wipes what they recorded. `cargo-llvm-cov` merges the profile data in the report. Measured on one tree, against a disposable PostgreSQL: line coverage goes from 79.86% (46780/58575) to 83.25% (48907/58748), and diesel_repo from 4.6% to 38.1%. All seven tests pass. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Frontend SPA coverage (by module)
Generated from Vitest |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The backend coverage report shows the real PostgreSQL layer,
repository/diesel_repo, at about 5%, although CI runs integration tests against it.The seven PostgreSQL integration tests start with
#![cfg(not(feature = "test-helpers"))]. The workspace coverage run (cargo cov --workspace) enablestest-helpersthroughmarreq-server/marreq-cloud, so they compile out of it. CI ran them earlier with plaincargo test, which is not instrumented, so their coverage was never recorded.What
In
.github/workflows/marreq-ci.yml, jobtest-and-coverage:cargo cov clean --workspace) before the Postgres tests.cargo cov --no-report -p marreq-core --test <name> -- --nocaptureinstead ofcargo test.--no-reportkeeps the profile data, andcargo-llvm-covmerges it with the workspace run in the report.cargo cov clean --workspacefrom Generate coverage reports, since it would wipe the data recorded above.No test or source code changes. The coverage gate stays at
--fail-under-lines 70.Measured effect
Both numbers come from the same tree, run in Docker against a disposable PostgreSQL, so the only difference is this change:
repository/diesel_repo/: 4.6% → 38.1%.use_cases.rs0% → 90%,requirements.rs0% → 48%,idempotency.rs0% → 92%,rate_limiter/postgres.rs34% → 93%,verification_control.rs0% → 100%.coverage-htmlartifact of a recent CI run (79.9%).What to check in this PR's CI
ci-coveragecache. Thetest-and-coveragejob and the posted coverage comment are the real check; expect the backend total to move from about 81% to about 84-85%.--ignore-filename-regex may not be used together with --no-reportwarning comes from the existingcovalias and already appears in the workspace run.Not in this PR
marreq-core/tests/delegated_oauth_mcp_tools_postgres_integration.rs(added in MCP: close tool gaps over existing endpoints (traceability edits, filters, close-out, use-case history) + resources/prompts #416) is not run in CI at all. Adding it is a separate decision.diesel_repofiles are still at 0%:attachments,groups,saved_views,identities,report_templates,comments.🤖 Generated with Claude Code