Skip to content

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

Merged
t0kubetsu merged 2 commits into
mainfrom
ci/coverage-gate-in-ci
Aug 12, 2026
Merged

ci: move the coverage gate out of addopts into the CI step#5
t0kubetsu merged 2 commits into
mainfrom
ci/coverage-gate-in-ci

Conversation

@t0kubetsu

Copy link
Copy Markdown
Contributor

The problem

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

Running a single test file measures the whole package while executing one file. Coverage lands in the low single digits, the gate fails, and pytest exits non-zero even though every selected test passed. Demonstrated on a sibling repo before making the change:

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

The fix

Move the threshold to the workflow's pytest step. CI still enforces 100% on the full suite; targeted runs stop failing.

Verified

pytest tests/test_assessor.py now exits 0 (11 passed); the full run still reports Required test coverage of 100% reached.

Scope

Sixth and last of six repos with this defect, all fixed identically. Raised by Greptile on chainvalidator#7, which is the reference shape.

--cov-fail-under in pyproject addopts applies to every pytest
invocation, not just full runs. A targeted command such as

    pytest tests/test_assessor.py -v

measures the whole package while executing one file, so it reports a few
percent coverage and exits non-zero even though every selected test
passed, making the documented developer workflow unusable.

The gate moves to the workflow pytest step: CI still enforces 100% on
the full suite, targeted runs behave again. Verified both directions.

@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: 18 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: 979e78f5-2d63-4b21-a6ef-d93d0582a382

📥 Commits

Reviewing files that changed from the base of the PR and between 42e0194 and 9c52645.

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

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

The coverage threshold moved to the CI pytest step in this branch, so the
'enforced via pyproject.toml addopts' line is no longer accurate.

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

@t0kubetsu
t0kubetsu merged commit fc77440 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