Skip to content

Test coverage#109

Merged
pbrassel merged 4 commits intomainfrom
test-coverage
Apr 20, 2026
Merged

Test coverage#109
pbrassel merged 4 commits intomainfrom
test-coverage

Conversation

@pbrassel
Copy link
Copy Markdown
Member

@pbrassel pbrassel commented Apr 20, 2026

Summary by CodeRabbit

  • Chores
    • Updated development tooling to enforce code coverage with a minimum 90% threshold.
    • Added a code coverage badge to the project documentation displaying current coverage metrics (96%).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Warning

Rate limit exceeded

@pbrassel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 24 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 24 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3841d239-9ad2-4fa4-aa24-f249cdac9a80

📥 Commits

Reviewing files that changed from the base of the PR and between 83f50b9 and 2e26ead.

📒 Files selected for processing (2)
  • .pre-commit-config.yaml
  • pyproject.toml
📝 Walkthrough

Walkthrough

The pull request adds code coverage tracking and enforcement to the project. It introduces pytest-cov for coverage collection, integrates readme-coverage-badger to maintain a coverage badge in the README, configures pre-push hooks for coverage checks, and sets a minimum coverage threshold of 90%.

Changes

Cohort / File(s) Summary
Testing & Coverage Configuration
.pre-commit-config.yaml, pyproject.toml
Adds pre-push hooks for pytest and readme-coverage-badger tool, configures pytest with coverage reporting and 90% minimum threshold enforcement, and introduces coverage-related dependencies.
Documentation
README.md
Adds code coverage badge (96%) to the top of the README.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A coverage badge now gleams so bright,
With hooks and tests aligned just right,
Ninety percent ensures the code stays tight,
Our project's quality shines in the light! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Test coverage' is partially related to the main changes but lacks specificity and doesn't capture the primary objective of implementing coverage tooling and tracking. Consider a more specific title like 'Add pytest-cov integration and coverage tracking' or 'Implement code coverage monitoring with pytest-cov and badger' to better convey the comprehensive scope of changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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 test-coverage

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 and usage tips.

Copy link
Copy Markdown

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

🧹 Nitpick comments (2)
pyproject.toml (1)

60-60: Global --cov-fail-under=90 in addopts applies to every pytest invocation.

Because these flags live in addopts, any subset run (e.g. pytest tests/unit, pytest -k foo, or pytest -m "not integration") will also collect coverage against the full flame_hub package and fail the 90% gate even when the subset legitimately can't reach it. This can make local/dev workflows noisy.

Consider moving the --cov-fail-under gate into the CI invocation (or a dedicated tox/make target) while keeping only --cov=flame_hub --cov-branch in addopts, or document the expectation to always run the full suite.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pyproject.toml` at line 60, The global pytest addopts currently includes a
coverage fail gate which forces every local/subset test run to enforce 90%
coverage; remove the string "--cov-fail-under=90" from the addopts setting (the
addopts entry in pyproject.toml) so addopts only contains "--cov=flame_hub
--cov-branch", and instead add the --cov-fail-under=90 flag to your CI pytest
invocation or a dedicated tox/make test target where the full-suite coverage
gate should be enforced.
.pre-commit-config.yaml (1)

32-35: Minor: types: [python] is a no-op here.

With always_run: true and pass_filenames: false, the types filter has no effect on whether the hook runs. Safe to remove for clarity.

♻️ Proposed cleanup
       - id: pytest
         name: pytest
         entry: pytest tests
         language: system
-        types: [python]
         always_run: true
         pass_filenames: false
         stages: [ pre-push ]
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml around lines 32 - 35, The "types: [python]" setting
is redundant because "always_run: true" and "pass_filenames: false" make the
types filter ineffective; remove the types: [python] line from the hook
definition so the hook configuration only contains always_run, pass_filenames,
and stages, keeping behavior unchanged and improving clarity (look for the hook
block containing the keys types, always_run, pass_filenames, and stages).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.pre-commit-config.yaml:
- Around line 32-35: The "types: [python]" setting is redundant because
"always_run: true" and "pass_filenames: false" make the types filter
ineffective; remove the types: [python] line from the hook definition so the
hook configuration only contains always_run, pass_filenames, and stages, keeping
behavior unchanged and improving clarity (look for the hook block containing the
keys types, always_run, pass_filenames, and stages).

In `@pyproject.toml`:
- Line 60: The global pytest addopts currently includes a coverage fail gate
which forces every local/subset test run to enforce 90% coverage; remove the
string "--cov-fail-under=90" from the addopts setting (the addopts entry in
pyproject.toml) so addopts only contains "--cov=flame_hub --cov-branch", and
instead add the --cov-fail-under=90 flag to your CI pytest invocation or a
dedicated tox/make test target where the full-suite coverage gate should be
enforced.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 04996f42-cf55-4799-97a8-e62626d75b08

📥 Commits

Reviewing files that changed from the base of the PR and between b25d7a6 and 83f50b9.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • .pre-commit-config.yaml
  • README.md
  • pyproject.toml

@pbrassel pbrassel merged commit a023071 into main Apr 20, 2026
7 checks passed
@pbrassel pbrassel deleted the test-coverage branch April 20, 2026 08:38
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