-
Notifications
You must be signed in to change notification settings - Fork 3
Configure coverage in pyproject.toml #779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Warning Rate limit exceeded@jan-janssen has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 3 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThe changes move coverage omit settings from the GitHub Actions workflow to the Changes
Sequence Diagram(s)sequenceDiagram
participant CI as GitHub Actions CI
participant Coverage as coverage.py
participant Config as pyproject.toml
CI->>Coverage: Run coverage (no omit options)
Coverage->>Config: Read omit rules and test command from pyproject.toml
CI->>Coverage: Run coverage with unittest on specified test files
Coverage->>Config: Apply omit rules from configuration
CI->>Coverage: Generate coverage report and XML
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #779 +/- ##
=======================================
Coverage 97.66% 97.66%
=======================================
Files 32 32
Lines 1453 1453
=======================================
Hits 1419 1419
Misses 34 34 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/pipeline.yml(1 hunks)pyproject.toml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
- GitHub Check: unittest_openmpi (ubuntu-latest, 3.12)
- GitHub Check: unittest_openmpi (ubuntu-latest, 3.13)
- GitHub Check: unittest_openmpi (ubuntu-22.04-arm, 3.13)
- GitHub Check: unittest_openmpi (ubuntu-latest, 3.11)
- GitHub Check: unittest_openmpi (macos-latest, 3.13)
- GitHub Check: unittest_mpich (ubuntu-22.04-arm, 3.13)
- GitHub Check: unittest_mpich (macos-latest, 3.13)
- GitHub Check: unittest_flux_openmpi
- GitHub Check: unittest_slurm_mpich
- GitHub Check: unittest_win
- GitHub Check: notebooks_integration
- GitHub Check: unittest_flux_mpich
- GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-openmpi.yml)
- GitHub Check: notebooks
- GitHub Check: benchmark (ubuntu-latest, 3.13, .ci_support/environment-mpich.yml)
🔇 Additional comments (3)
pyproject.toml (1)
128-128: Confirm coverage version recognizescommand_line.
coverage run -arelies on this config when no args are provided. Ensure the installed coverage version in CI supportscommand_linein pyproject (coverage 6+). If not, that step will no-op/fail.Suggested quick check in CI:
coverage --version- Run
coverage debug configand verify it lists[run] command_lineand the omit rules sourced frompyproject.toml..github/workflows/pipeline.yml (2)
246-246: Relying onpyproject.tomlcommand_line is okay; ensure CWD is repo root.
coverage run -awith no args will use the configured command line. This looks correct given the new config.Double-check the step’s working directory is the repo root (so coverage finds
pyproject.toml). Default for Actions steps is the workspace root, so this should be fine.
252-252: LGTM; omit rules are now centralized.Explicit test files are fine here, and central omit rules keep the command clean. No issues.
| [tool.coverage.run] | ||
| omit = ["executorlib/_version.py", "tests/*"] | ||
| command_line = "-m unittest discover tests" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Constrain coverage to project source to avoid noise from dependencies.
Without a source setting, coverage can record any traced files, potentially including third-party modules. It’s best practice to target the package.
[tool.coverage.run]
+source = ["executorlib"]
omit = ["executorlib/_version.py", "tests/*"]
command_line = "-m unittest discover tests"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| [tool.coverage.run] | |
| omit = ["executorlib/_version.py", "tests/*"] | |
| command_line = "-m unittest discover tests" | |
| [tool.coverage.run] | |
| source = ["executorlib"] | |
| omit = ["executorlib/_version.py", "tests/*"] | |
| command_line = "-m unittest discover tests" |
🤖 Prompt for AI Agents
In pyproject.toml around lines 126 to 128, the coverage configuration lacks a
'source' setting, causing coverage to include files outside the project like
dependencies. Add a 'source' key under [tool.coverage.run] specifying the
project package or source directory to limit coverage measurement to your own
code and avoid noise from third-party modules.
| [tool.coverage.run] | ||
| omit = ["executorlib/_version.py", "tests/*"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Broaden test omit pattern to cover nested test packages.
The pattern tests/* only excludes files directly under tests/. It won’t omit nested paths like tests/benchmark/test_results.py. Use a recursive pattern if supported, or add additional globs.
Apply one of the following:
Option A (coverage >= 7 supports recursive globs):
[tool.coverage.run]
-omit = ["executorlib/_version.py", "tests/*"]
+omit = ["executorlib/_version.py", "tests/**"]Option B (portable without recursive globs):
[tool.coverage.run]
-omit = ["executorlib/_version.py", "tests/*"]
+omit = [
+ "executorlib/_version.py",
+ "tests/*",
+ "tests/*/*",
+ "tests/*/*/*"
+]🤖 Prompt for AI Agents
In pyproject.toml at lines 126 to 127, the omit pattern "tests/*" only excludes
files directly under the tests directory and misses nested test files. To fix
this, update the omit pattern to a recursive glob like "tests/**" if using
coverage version 7 or higher, or alternatively add multiple patterns to cover
nested directories for broader exclusion of test files.
Summary by CodeRabbit