Skip to content

Include gpu and example tests also in codecov coverage reporting and enable omitted folder coverage#1154

Merged
kevalmorabia97 merged 1 commit intomainfrom
kevalmorabia97-patch-2
Apr 1, 2026
Merged

Include gpu and example tests also in codecov coverage reporting and enable omitted folder coverage#1154
kevalmorabia97 merged 1 commit intomainfrom
kevalmorabia97-patch-2

Conversation

@kevalmorabia97
Copy link
Copy Markdown
Collaborator

@kevalmorabia97 kevalmorabia97 commented Apr 1, 2026

So far, we only measured unit test coverage but we also have gpu test and example tests which needed to be setup differently to track in overall codecov coverage so we get accurate coverage reporting

Summary by CodeRabbit

  • Chores
    • Strengthened code coverage measurement with parallelized collection across unit, GPU, and example test suites
    • Enhanced continuous integration workflow configuration with improved coverage reporting and threshold management
    • Updated testing infrastructure dependencies and settings to support more robust quality assurance processes

@kevalmorabia97 kevalmorabia97 requested a review from a team as a code owner April 1, 2026 12:21
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR implements unified coverage collection across multiple test suites by updating configuration to enable parallel coverage tracking, adding environment variables for coverage subprocess handling, configuring Codecov uploads with test-category flags, and making coverage arguments configurable via tox environment variables.

Changes

Cohort / File(s) Summary
Coverage Configuration
pyproject.toml
Added coverage[toml]>=7.13.0 to dev-test dependencies. Reworked [tool.coverage.run] to enable parallel coverage with parallel = true, concurrency = ["multiprocessing", "thread"], and source_pkgs = ["modelopt", "modelopt_recipes"]. Removed fail_under = 70 enforcement threshold from [tool.coverage.report].
Codecov Configuration
.github/codecov.yml
Enabled flag_management.default_rules.carryforward: true for coverage reuse across runs. Lowered project coverage drop threshold from 5% to 2%.
CI Workflows — Coverage Integration
.github/workflows/_example_tests_runner.yml, .github/workflows/gpu_tests.yml, .github/workflows/unit_tests.yml
Added coverage collection to test execution steps via COVERAGE_PROCESS_START and COVERAGE_FILE environment variables, and --cov flag in pytest/tox commands. Integrated Codecov uploads with codecov/codecov-action@v5 using test-category-specific flags (flags: examples, flags: gpu, flags: unit) and non-critical error handling (fail_ci_if_error: false).
Test Environment Configuration
tox.ini
Modified cuda13-gpu environments to append {env:COV_ARGS:} to pytest commands, allowing coverage arguments to be controlled via environment variable instead of being hardcoded. Removed inline comment discouraging --cov usage.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the PR: including GPU and example tests in Codecov coverage reporting and enabling coverage for previously omitted folders.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Anti-Patterns ✅ Passed PR adds coverage[toml] dependency and updates CI configuration with no security anti-patterns detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kevalmorabia97-patch-2

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-01 20:15 UTC

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pyproject.toml`:
- Line 278: The coverage threshold was lowered to fail_under = 65 without a
restoration plan; add a concise comment directly above the fail_under = 65
setting describing the tracking issue number (or create one) and target date to
restore fail_under back to 70+, the rationale for the temporary 65% threshold
and expected timeline, and a note about why existing excludes (e.g.,
*/plugins/*, */export/*) remain sufficient; additionally, review and, if
appropriate, document alternative temporary exclusions under [tool.coverage.run]
(mention relevant module patterns) instead of lowering the global threshold so
reviewers can see the remediation plan and accountability.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ceb8f12e-2c0e-470d-a5ce-9cf4e6dceca5

📥 Commits

Reviewing files that changed from the base of the PR and between c37c74f and eeb4c25.

📒 Files selected for processing (1)
  • pyproject.toml

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.84%. Comparing base (c37c74f) to head (15a18b4).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1154      +/-   ##
==========================================
+ Coverage   70.20%   75.84%   +5.64%     
==========================================
  Files         230      349     +119     
  Lines       26098    39823   +13725     
==========================================
+ Hits        18322    30204   +11882     
- Misses       7776     9619    +1843     
Flag Coverage Δ
examples 43.93% <ø> (?)
gpu 57.10% <ø> (?)
unit 54.55% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kevalmorabia97 kevalmorabia97 force-pushed the kevalmorabia97-patch-2 branch from eeb4c25 to 3519464 Compare April 1, 2026 12:54
@kevalmorabia97 kevalmorabia97 changed the title Reduce unit test coverage from 70% to 65% to unblock PRs Report gpu and example tests also in codecov coverage reporting Apr 1, 2026
@kevalmorabia97 kevalmorabia97 force-pushed the kevalmorabia97-patch-2 branch 2 times, most recently from 9fa84e5 to d73ad0f Compare April 1, 2026 14:28
@kevalmorabia97 kevalmorabia97 changed the title Report gpu and example tests also in codecov coverage reporting Include gpu and example tests also in codecov coverage reporting and enable omitted folder coverage Apr 1, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pyproject.toml`:
- Around line 273-275: The project enables parallel coverage collection
(parallel = true) so child processes produce .coverage.* shards but CI never
runs coverage combine before generating/uploading coverage.xml, causing lost
subprocess data; fix by adding a CI step to run "coverage combine" prior to
generating/ uploading coverage (e.g., before the codecov/codecov-action step) or
instead update the coverage config in pyproject.toml by adding patch =
"subprocess" under [tool.coverage.run] so modern Coverage.py auto-combines; also
ensure the sitecustomize.py subprocess hook and pytest-cov usage are compatible
with whichever approach you choose.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4ee46094-73bc-4676-a202-2f9a734fbdf3

📥 Commits

Reviewing files that changed from the base of the PR and between 9fa84e5 and d73ad0f.

📒 Files selected for processing (7)
  • .github/codecov.yml
  • .github/sitecustomize.py
  • .github/workflows/_example_tests_runner.yml
  • .github/workflows/gpu_tests.yml
  • .github/workflows/unit_tests.yml
  • pyproject.toml
  • tox.ini
✅ Files skipped from review due to trivial changes (2)
  • .github/workflows/unit_tests.yml
  • .github/sitecustomize.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/codecov.yml
  • tox.ini
  • .github/workflows/gpu_tests.yml
  • .github/workflows/_example_tests_runner.yml

Copy link
Copy Markdown
Collaborator

@shengliangxu shengliangxu left a comment

Choose a reason for hiding this comment

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

LGTM

@kevalmorabia97 kevalmorabia97 force-pushed the kevalmorabia97-patch-2 branch from d73ad0f to 9e3210b Compare April 1, 2026 17:31
Signed-off-by: Keval Morabia <28916987+kevalmorabia97@users.noreply.github.com>
@kevalmorabia97 kevalmorabia97 force-pushed the kevalmorabia97-patch-2 branch from 9e3210b to 15a18b4 Compare April 1, 2026 17:36
@kevalmorabia97 kevalmorabia97 merged commit 2ae407c into main Apr 1, 2026
87 of 93 checks passed
@kevalmorabia97 kevalmorabia97 deleted the kevalmorabia97-patch-2 branch April 1, 2026 20:15
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