-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add codecov integration with test results upload #13
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
- Add .codecov.yml configuration with project and patch coverage checks (0.05% threshold) - Configure jest to output test results in JUnit XML format using jest-junit reporter - Update pytest to output coverage in XML format and test results in JUnit XML format - Add codecov/codecov-action@v5 step to upload coverage from both jest (lcov) and pytest (xml) - Add codecov/test-results-action@v1 step to upload test results from both test suites - Set fail_ci_if_error: false for coverage upload to prevent blocking CI if codecov has issues - Use if: '!cancelled()' for test results upload to ensure results are uploaded even if tests fail Follows the same codecov configuration pattern as deepnote-internal and deepnote-toolkit repos. Note: CODECOV_TOKEN secret needs to be configured in repository settings for codecov uploads to work.
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
📝 WalkthroughWalkthroughAdds a Codecov config (.codecov.yml) setting project and patch coverage status targets to Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub Actions
participant Py as Pytest
participant Je as Jest
participant CC as Codecov
Dev->>GH: push / open PR triggers build workflow
GH->>Py: Run pytest --cov jupyterlab_deepnote\n--cov-report=xml --junit-xml=coverage/pytest-results.xml
Py-->>GH: coverage.xml + coverage/pytest-results.xml
GH->>Je: Run Jest (coverageDirectory='./coverage')\nreporters: default + jest-junit -> coverage/junit.xml
Je-->>GH: coverage files + coverage/junit.xml
GH->>CC: codecov-action@v5 upload (coverage.xml, coverage/lcov.info)
alt workflow not cancelled
GH->>CC: codecov/test-results-action@v1 upload (coverage/pytest-results.xml, coverage/junit.xml)
end
Note right of CC #D7EAF3: .codecov.yml sets\nproject & patch target: auto\nthreshold: 0.05%
Possibly related PRs
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
⏰ 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). (2)
Comment |
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: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (3)
.codecov.yml(1 hunks).github/workflows/build.yml(2 hunks)jest.config.js(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-08T23:11:17.867Z
Learnt from: CR
PR: deepnote/deepnote-toolkit#0
File: CLAUDE.md:0-0
Timestamp: 2025-09-08T23:11:17.867Z
Learning: Use the provided code coverage commands and thresholds
Applied to files:
.codecov.yml
⏰ 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). (2)
- GitHub Check: check_release
- GitHub Check: build
🔇 Additional comments (1)
.codecov.yml (1)
1-10: LGTM: Codecov thresholds align with team standards.Config is valid. The 0.05% threshold is lenient but matches established practices.
Based on learnings.
- Create coverage directory before pytest runs to ensure junit xml output succeeds - Fix codecov upload file paths (coverage.xml and coverage/lcov.info) - Configure jest-junit to output to coverage/junit.xml explicitly - Set coverageDirectory to ./coverage for consistency Addresses CodeRabbit review comments.
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build.yml(2 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). (2)
- GitHub Check: build
- GitHub Check: check_release
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 ☂️ |
Add fail_ci_if_error: true to test results upload step to ensure CI fails when codecov upload fails, matching the coverage upload configuration.
54f451d
feat: add codecov integration with test results upload
Summary
Adds codecov integration to the CI pipeline to upload coverage reports and test results. The implementation follows the same pattern as
deepnote-internalanddeepnote-toolkitrepositories.Changes:
.codecov.yml: Added codecov configuration with project and patch coverage checks (0.05% threshold, auto target)jest.config.js: Addedjest-junitreporter to output test results in JUnit XML format.github/workflows/build.yml:--cov-report=xml) and test results (--junit-xml=coverage/pytest-results.xml)fail_ci_if_error: falseto prevent blocking CI if codecov has issuesReview & Testing Checklist for Human
coverage.xml,coverage/lcov.info,coverage/pytest-results.xml,coverage/junit.xml)Notes
This PR implements codecov integration as requested. The configuration matches the patterns used in other Deepnote repositories (
deepnote-internalanddeepnote-toolkit). The jest-junit package was already available inyarn.lock, so I configured it as a reporter.If CODECOV_TOKEN is not configured, the codecov upload steps will fail but won't block CI due to
fail_ci_if_error: falsesetting.Link to Devin run: https://app.devin.ai/sessions/469dd0ba825c4715b7080a86ea978fcb
Requested by: @jamesbhobbs
Summary by CodeRabbit
Chores
Tests