ci: move the coverage gate out of addopts into the CI step - #8
Conversation
--cov-fail-under in pyproject addopts applies to every pytest invocation,
not just full runs. A targeted command from CLAUDE.md such as
pytest tests/test_assessor.py::TestAssess -v
measures the whole package while executing one class, so it reports
roughly 3% coverage and exits non-zero even though every selected test
passed. That makes the documented developer workflow unusable.
The gate moves to the workflow pytest step: CI still enforces the same
threshold on the full suite, targeted runs behave again.
Verified both directions -- the targeted command now exits 0, and the
full run still reports "Required test coverage ... reached".
There was a problem hiding this comment.
t0kubetsu has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Warning Review limit reached
Next review available in: 20 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Comment |
The problem
--cov-fail-under=100sits inpyproject.tomladdopts, so it applies to every pytest invocation — not just full runs.A targeted command of the kind CLAUDE.md documents:
measures the whole package while executing one class. Coverage lands around 3%, the gate fails, and pytest exits non-zero even though every selected test passed. Demonstrated on headersvalidator before making the change:
That makes the documented developer workflow unusable — you cannot run a single test class without a spurious failure.
The fix
Move the threshold to the workflow's pytest step. CI still enforces the same number on the full suite; targeted runs stop failing.
Verified
Targeted run now exits 0; the full run still reports
Required test coverage ... reached.Scope
This is one of six repos with the same defect, all being fixed identically. Raised by Greptile on chainvalidator#7; chainvalidator is already fixed and is the reference shape.