Raise test coverage past the per-module gate (core ≥95%, others ≥90%)#7
Merged
Merged
Conversation
scripts/check_coverage.py reads the coverage JSON report and fails if any mcp_servers module is below its floor — core modules (the store engines, common, staleness, egress SSRF guard, models) must clear 95%, all other modules 90%. This enforces coverage per file so a well-covered module cannot mask a thin one, which a single total `fail_under` would allow. CI: the test job now emits a JSON coverage report and runs the gate; the pyproject total backstop is raised 80 -> 90. (Tests to satisfy the gate land in a follow-up commit.) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fd4FtxJFV2fVSSoD7urqqn
Six new tests/test_*_cov.py files lift coverage above the per-module floors (core >= 95%, others >= 90%), adding 82 tests (152 -> 234). Each exercises the previously-thin branches — the FastMCP tool wrappers' success/error paths and main() fail-closed, store rollback/WAL/guard branches, the egress SSRF redirect and pinned-TLS paths, EXIF GPS extraction, and the manifest migration edges: - calibration_tracker server 55->100%, store 88->100% - evidence_ledger server 63->99% - ach_engine server 73->100%, store 94->100% - osint_toolkit server 62->98%, egress 87->100%, exif 63->100% - common 89->100%, staleness 92->100% README: document the per-module coverage gate. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fd4FtxJFV2fVSSoD7urqqn
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7 +/- ##
===========================================
+ Coverage 85.25% 99.14% +13.89%
===========================================
Files 17 17
Lines 1756 1756
===========================================
+ Hits 1497 1741 +244
+ Misses 259 15 -244 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
What
Raises coverage so every
mcp_serversmodule clears a per-module floor — not just the average — and enforces it in CI.The gate
scripts/check_coverage.pyreads the coverage JSON and fails if any module is below its floor:store.pyengines,common.py,staleness.py, theegress.pySSRF guard, and allmodels.py.server.py) and OSINT IO helpers (exif.py,artifacts.py,audit.py).Enforced per file so a well-covered module can't mask a thin one. Wired into the CI test job (JSON coverage report + gate step); the pyproject total backstop is also raised 80 → 90.
The tests
Six new
tests/test_*_cov.pyfiles, +82 tests (152 → 234), targeting the previously-thin branches — tool-wrapper success/error paths andmain()fail-closed, store rollback/WAL/guard branches, the egress SSRF redirect + pinned-TLS path, EXIF GPS extraction, and manifest-migration edges:Every module now sits at 96–100%.
Verified locally
scripts/check_coverage.py: gate OK — all 17 modules meet their floor.🤖 Generated with Claude Code
https://claude.ai/code/session_01Fd4FtxJFV2fVSSoD7urqqn
Generated by Claude Code