feat: introduce code coverage and mutation testing infrastructure#343
Draft
Copilot wants to merge 2 commits into
Draft
feat: introduce code coverage and mutation testing infrastructure#343Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Add pytest-cov (7.1.0) and mutmut (3.5.0) with: - Coverage config in pyproject.toml (branch coverage, 80% threshold) - Ratcheting threshold file (.coverage-threshold) - Wrapper scripts: test-coverage.sh, test-mutmut.sh - CI workflows: coverage.yml (PRs + main), mutation-tests.yml (weekly) - ADR-002 documenting tool selection rationale - Updated TESTING.md and python.instructions.md Agent-Logs-Url: https://github.com/kellerlabs/homeracker/sessions/404faffd-118c-417f-a6f3-e468a836906f Co-authored-by: kellervater <33324812+kellervater@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add code coverage and mutation testing integration
feat: introduce code coverage and mutation testing infrastructure
Apr 18, 2026
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
Adds pytest-cov (7.1.0) for code coverage and mutmut (3.5.0) for mutation testing, with CI workflows, wrapper scripts, and a ratcheting threshold mechanism.
requirements.txt— pinnedpytest-cov==7.1.0,mutmut==3.5.0cmd/scadm/pyproject.toml—[tool.coverage.*](branch coverage, exclusions) and[tool.mutmut]configcmd/scadm/.coverage-threshold— persisted threshold (starts at 80%), ratchets upward on successcmd/test/test-coverage.sh— runs coverage, enforces threshold, updates ratchet filecmd/test/test-mutmut.sh— runs mutation testing locally.github/workflows/coverage.yml— PRs + main pushes (scoped tocmd/scadm/**).github/workflows/mutation-tests.yml— weekly cron (Monday 03:00 UTC) +workflow_dispatchdocs/decisions/ADR-002-code-coverage-mutation-testing.md— tool selection rationaleTESTING.md,.github/instructions/python.instructions.md,.gitignore💡 Why
Coverage (quantity) + mutation testing (quality) as deterministic guardrails for AI-assisted development. Tool choices documented in ADR-002:
Mutation tests run weekly (not per-PR) because they're CPU-intensive. The ratchet mechanism ensures coverage monotonically increases — the threshold file is updated to the actual value on each passing run.
🔧 How
Config lives in
cmd/scadm/pyproject.tomlunder[tool.coverage.*]and[tool.mutmut]. The ratchet threshold is incmd/scadm/.coverage-threshold— do not lower it manually.