Skip to content

Only upload test results to Codecov when pytest actually ran - #25

Merged
JohnRDOrazio merged 1 commit into
mainfrom
ci-test-results-upload-guard
Aug 3, 2026
Merged

Only upload test results to Codecov when pytest actually ran#25
JohnRDOrazio merged 1 commit into
mainfrom
ci-test-results-upload-guard

Conversation

@JohnRDOrazio

Copy link
Copy Markdown
Member

The test-results upload is guarded by if: ${{ !cancelled() }}, which is
deliberate: when the suite runs and fails, that is precisely when Codecov's
test analytics is worth having, so it must not be skipped on failure.

But that condition cannot tell "tests ran and failed" from "tests never ran".
When an earlier step fails -- pyright did, on PR #23 -- GitHub skips the pytest
step, so no junit.xml is produced, while the upload step still executes and
reports "The CLI was unable to find any JUnit XML files to upload." That reads
like a broken Codecov configuration and draws attention away from the actual
failure, which was three steps earlier.

Giving pytest an id and adding steps.pytest.conclusion != 'skipped' keeps the
valuable case and drops the noisy one. The coverage upload needed no change: it
carries no if, so it already inherits the default success() condition and was
correctly skipped in that run.

Note this cannot be demonstrated by a green CI run, which exercises only the
unchanged path. It was verified against run 30808584716, where the step list
shows pytest skipped and the upload succeeding with nothing to upload.

🤖 Generated with Claude Code

The test-results upload is guarded by `if: ${{ !cancelled() }}`, which is
deliberate: when the suite runs and fails, that is precisely when Codecov's
test analytics is worth having, so it must not be skipped on failure.

But that condition cannot tell "tests ran and failed" from "tests never ran".
When an earlier step fails -- pyright did, on PR #23 -- GitHub skips the pytest
step, so no junit.xml is produced, while the upload step still executes and
reports "The CLI was unable to find any JUnit XML files to upload." That reads
like a broken Codecov configuration and draws attention away from the actual
failure, which was three steps earlier.

Giving pytest an id and adding `steps.pytest.conclusion != 'skipped'` keeps the
valuable case and drops the noisy one. The coverage upload needed no change: it
carries no `if`, so it already inherits the default success() condition and was
correctly skipped in that run.

Note this cannot be demonstrated by a green CI run, which exercises only the
unchanged path. It was verified against run 30808584716, where the step list
shows pytest skipped and the upload succeeding with nothing to upload.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 48 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c513b506-a30e-4782-96d2-b4d75d93bfcc

📥 Commits

Reviewing files that changed from the base of the PR and between 2e1e879 and d080321.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@JohnRDOrazio
JohnRDOrazio merged commit 4028e0a into main Aug 3, 2026
4 checks passed
@JohnRDOrazio
JohnRDOrazio deleted the ci-test-results-upload-guard branch August 3, 2026 13:04
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.

2 participants