chore(coverage): measure and print statement coverage, no threshold - #53
Merged
Merged
Conversation
No coverage percentage was measured or gated anywhere in this repo: no coverage/pytest-cov dependency, no CI step read one (recorded as a gap in the architecture dossier's read of this repo). Per the project's standing rule that test coverage is maximised and reported, not merely available, add the measurement without changing behaviour. - pytest-cov added to the dev extra. - [tool.coverage.run]/[tool.coverage.report] in pyproject.toml: source is the engram package, tests/ omitted, no fail_under. Whether to gate on a threshold is a separate decision for the project owner; this only makes the number visible. - CI's test job now runs `pytest --cov=engram --cov-report=term-missing` instead of plain pytest, so the TOTAL line prints on every push across the 3.11/3.12/3.13 matrix, at no extra cost: it is the same pytest invocation the job already made. - README states the measured figure next to the existing test-coverage heading, with the command that produced it. scripts/readme-numbers.sh deliberately does NOT recompute this number the way it recomputes the test count: that check uses --collect-only to stay near-instant, and a full pytest --cov run costs about 50 seconds here. Wiring it in would multiply that cost 5-6x inside gates-have-teeth.sh, which replays readme-numbers.sh once per fault case it exercises. Measured: readme-numbers.sh unchanged in scope stays at about 1.2s; a full pytest --cov=engram --cov-report=term-missing run here takes about 53s to 57s. Left as a comment in the script and as a decision for the project owner rather than made unilaterally. @measured 2026-09-16, this .venv (.venv/bin/pytest --cov=engram --cov-report=term-missing): 89% statement coverage on a plain install (2679 statements, 293 uncovered) and 89% with the encryption extra installed (282 uncovered; the extra exercises the Engram(key=...) path so its raw miss count is lower, though the two round to the same percentage today). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ve no gate yet Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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
No coverage percentage was measured or gated anywhere in this repository:
no
coverage/pytest-covdependency, no CI step read one. This adds themeasurement without changing behaviour: no dependency swap, no algorithm
touched, no threshold that can fail a build.
pytest-covadded to thedevextra (pyproject.toml).[tool.coverage.run](source =engram,tests/*omitted) and[tool.coverage.report](nofail_under) inpyproject.toml.testjob now runspytest --cov=engram --cov-report=term-missinginstead of plain
pytest, printing theTOTALline on every push, acrossthe 3.11/3.12/3.13 matrix, at no extra cost (same pytest invocation the
job already made).
heading, with the command that produced it.
A deliberate limit, not an oversight
scripts/readme-numbers.shdoes not recompute this number the way itrecomputes the test count. The test count uses
--collect-onlyspecifically to stay near-instant (about 1.2s measured); a full
pytest --covrun here takes about 53-57s. Wiring coverage into thatscript's auto-check would multiply its cost 5-6x inside
gates-have-teeth.sh, which replaysreadme-numbers.shonce per fault caseit exercises (roughly 5 minutes added to what is today a ~7 second run).
Measured both ways before deciding:
gates-have-teeth.shwith the coveragerecompute wired in versus without it is the same 8-case harness, at 7.3s
total either way once the recompute was left out. The comment in
readme-numbers.shnames this as a call for the project owner to override,not a closed decision.
Report
🤖 Generated with Claude Code