Skip to content

Add coverage floor threshold (--cov-fail-under=75)#254

Open
mvillmow wants to merge 2 commits into
mainfrom
148-auto-impl
Open

Add coverage floor threshold (--cov-fail-under=75)#254
mvillmow wants to merge 2 commits into
mainfrom
148-auto-impl

Conversation

@mvillmow

@mvillmow mvillmow commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Configure a 75% code coverage floor in pyproject.toml to prevent silent coverage regressions
  • Mirror explicit --cov-fail-under=75 flag in both ci.yml and _required.yml for visibility
  • Add development guideline to CLAUDE.md documenting the floor and how to reproduce it locally

Implementation Details

The implementation follows the approved plan from issue #148:

  1. pyproject.toml: Added [tool.coverage.run] source = ["telemachy"] and [tool.coverage.report] fail_under = 75
  2. ci.yml: Added --cov-fail-under=75 to the pytest command (line 34)
  3. _required.yml: Added full coverage flags to the unit-tests job (line 185) to ensure the required gate enforces the floor
  4. CLAUDE.md: Documented the floor and reproduction steps in Development Guidelines

Verification

Verified all acceptance criteria from the plan:

  • ✓ Explicit flag check: pixi run pytest ... --cov-fail-under=75 exits 0 with "Required test coverage of 75% reached"
  • ✓ Config-sourced check: pixi run pytest ... --cov=telemachy (without explicit flag) also enforces the floor via pyproject.toml
  • ✓ Regression simulation: Removing test file drops coverage to 52%, floor correctly rejects with "FAIL Required test coverage of 75.0% not reached"
  • ✓ YAML validation: Both workflow files pass syntax checks
  • ✓ TOML parsing: pyproject.toml parses correctly with fail_under = 75
  • ✓ Linting: ruff check and yamllint pass

Closes #148

@mvillmow mvillmow left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — cov-fail-under=75 configured in pyproject.toml + mirrored in ci.yml and the required _required.yml gate; source pin prevents flag-less false-pass. Correct, complete, well-scoped.

Configure a 75% code coverage floor in pyproject.toml [tool.coverage.report]
with explicit CLI flags in both CI workflows to prevent silent coverage
regressions. The floor is sourced from config and mirrored in ci.yml and
_required.yml for visibility.

Fixes #148

Signed-off-by: mvillmow <4211002+mvillmow@users.noreply.github.com>
GHSA-4xgf-cpjx-pc3j)

Signed-off-by: Micah Villmow <4211002+mvillmow@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MINOR] §5: No coverage minimum threshold configured

1 participant