Skip to content

ci: move the coverage gate out of addopts into the CI step - #7

Merged
t0kubetsu merged 1 commit into
mainfrom
ci/coverage-gate-in-ci
Aug 12, 2026
Merged

ci: move the coverage gate out of addopts into the CI step#7
t0kubetsu merged 1 commit into
mainfrom
ci/coverage-gate-in-ci

Conversation

@t0kubetsu

Copy link
Copy Markdown
Collaborator

The problem

--cov-fail-under=80 sits in pyproject.toml addopts, so it applies to every pytest invocation — not just full runs.

A targeted command of the kind CLAUDE.md documents:

pytest tests/test_assessor.py::TestAssess -v

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:

5 passed in 0.05s
FAIL Required test coverage of 100% not reached. Total coverage: 3.32%
exit code = 1

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.

--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".

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

t0kubetsu has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@t0kubetsu, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 19 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5037b490-dc82-4a2a-8061-3c1639da0748

📥 Commits

Reviewing files that changed from the base of the PR and between 09b3a17 and 581ffee.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • pyproject.toml

Comment @coderabbitai help to get the list of available commands.

@t0kubetsu
t0kubetsu merged commit b5b36fe into main Aug 12, 2026
4 checks passed
@t0kubetsu
t0kubetsu deleted the ci/coverage-gate-in-ci branch August 12, 2026 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant