Skip to content

Add code coverage with Codecov#5

Merged
oleksandr-nc merged 4 commits into
mainfrom
feature/p2-code-coverage
Mar 24, 2026
Merged

Add code coverage with Codecov#5
oleksandr-nc merged 4 commits into
mainfrom
feature/p2-code-coverage

Conversation

@bigcat88
Copy link
Copy Markdown
Contributor

@bigcat88 bigcat88 commented Mar 24, 2026

Summary

  • Add pytest-cov to dev dependencies
  • CI collects coverage from unit tests (Python 3.12) and integration tests (NC 33), uploads to Codecov
  • Add CI status and Codecov badges to README

Test plan

  • pytest-cov works locally
  • Lint/format/pyright clean
  • CI passes and uploads coverage reports
  • Codecov badge renders after first upload

Note: Codecov needs to be enabled for the repo at codecov.io (public repos work without a token).

Summary by CodeRabbit

  • Chores

    • Established automated linting, type checking, and testing workflows
    • Integrated code coverage tracking and reporting
    • Added development dependencies for test coverage collection
  • Documentation

    • Added CI/CD and code coverage status badges to README

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 24, 2026

Warning

Rate limit exceeded

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

⌛ 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: 0ac8ceec-7dad-4506-af0f-9d846489bdf4

📥 Commits

Reviewing files that changed from the base of the PR and between 7e014d0 and 14333b6.

📒 Files selected for processing (2)
  • .github/workflows/tests-integration.yml
  • .github/workflows/tests-unit.yml
📝 Walkthrough

Walkthrough

The PR restructures the GitHub Actions CI/CD pipeline by splitting linting, unit testing, and integration testing into separate dedicated workflows. Integration tests are enhanced with code coverage collection and Codecov reporting. Development dependencies and README documentation are updated to support these changes.

Changes

Cohort / File(s) Summary
GitHub Actions Workflows
.github/workflows/lint.yml, .github/workflows/tests-unit.yml, .github/workflows/tests-integration.yml
Introduces dedicated lint.yml and tests-unit.yml workflows; refactors tests-integration.yml to remove lint/unit test jobs and add Codecov coverage reporting with version-specific tagging.
Project Configuration & Documentation
pyproject.toml, README.md
Adds pytest-cov>=6 to dev dependencies; updates README with CI status badges for lint, unit tests, integration tests, and code coverage.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

Workflows split and organized with care, 🐰
Linting, testing—each job gets its own stage,
Coverage badges shine from the README fair,
The CI pipeline's entered a new age,
Fast checks, clear signals—a tester's delight! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add code coverage with Codecov' directly describes the main objective of the changeset, which adds pytest-cov dependency, configures CI workflows to collect coverage metrics, and uploads reports to Codecov.
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 feature/p2-code-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.

@bigcat88 bigcat88 marked this pull request as ready for review March 24, 2026 06:58
@bigcat88
Copy link
Copy Markdown
Contributor Author

(AI) Ready for review. All checks green. Split CI into 3 workflow files (lint, unit tests, integration tests), added pytest-cov with Codecov uploads from all matrix jobs, and added badges to README.

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 (1)
.github/workflows/lint.yml (1)

1-35: Well-structured lint workflow.

The workflow correctly separates linting/type-checking concerns and properly leverages the tool configurations in pyproject.toml. All required tools (ruff, isort, pyright) are available via the [dev] extras.

Consider adding pip caching to speed up workflow runs:

♻️ Optional: Add pip caching
       - uses: actions/setup-python@v5
         with:
           python-version: "3.12"
+          cache: pip
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/lint.yml around lines 1 - 35, Add a pip cache step to the
"lint" job to speed up the "Install dependencies" step: insert an
actions/cache@v4 step before the "Install dependencies" step that caches the pip
cache directory (e.g. ~/.cache/pip) using a key that incorporates the runner OS
and a hash of dependency files (for example hashFiles('**/pyproject.toml') or
similar) and include sensible restore-keys; this will reduce repeated network
installs for the pip install -e ".[dev]" command run in the Install dependencies
step after actions/setup-python@v5.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/lint.yml:
- Around line 1-35: Add a pip cache step to the "lint" job to speed up the
"Install dependencies" step: insert an actions/cache@v4 step before the "Install
dependencies" step that caches the pip cache directory (e.g. ~/.cache/pip) using
a key that incorporates the runner OS and a hash of dependency files (for
example hashFiles('**/pyproject.toml') or similar) and include sensible
restore-keys; this will reduce repeated network installs for the pip install -e
".[dev]" command run in the Install dependencies step after
actions/setup-python@v5.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: bef8b154-d43b-4ef1-acb0-4fc7f4931b08

📥 Commits

Reviewing files that changed from the base of the PR and between 4e96747 and 7e014d0.

📒 Files selected for processing (5)
  • .github/workflows/lint.yml
  • .github/workflows/tests-integration.yml
  • .github/workflows/tests-unit.yml
  • README.md
  • pyproject.toml

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2026

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@oleksandr-nc oleksandr-nc merged commit d609c89 into main Mar 24, 2026
8 checks passed
@oleksandr-nc oleksandr-nc deleted the feature/p2-code-coverage branch March 24, 2026 07: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