feat: add codecov integration with test results upload#35
Conversation
- Add lcov reporter to nyc configuration for codecov compatibility - Add codecov upload steps to CI workflow for coverage and test results - Configure fail_ci_if_error: false to not block CI on codecov issues Project already has .github/codecov.yml with project and patch coverage checks configured.
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
📝 WalkthroughWalkthroughCI sets VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE=true for the test run, then runs tests. After tests, the workflow uploads coverage to Codecov via codecov/codecov-action@v5 (uploads coverage/lcov.info, uses secrets.CODECOV_TOKEN, fail_ci_if_error: true). If the run is not cancelled, it uploads test results via codecov/test-results-action@v1 (uploads test-report.xml, uses secrets.CODECOV_TOKEN, fail_ci_if_error: true). Node test coverage reporters now include lcov alongside existing reporters (html when enabled, text, text-summary). No exported/public API changes. Sequence Diagram(s)sequenceDiagram
autonumber
actor Dev as Developer
participant GH as GitHub Actions (CI)
participant Tests as Test Runner + NYC
participant Codecov as Codecov
Dev->>GH: Push / PR triggers CI
GH->>Tests: Set env VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE=true
GH->>Tests: Run tests
Tests->>Tests: Produce coverage (text, text-summary, lcov, html*)
note right of Tests #D3E4CD: lcov.info emitted
GH->>Codecov: Upload coverage (codecov-action@v5)<br/>inputs: coverage/lcov.info, token<br/>fail_ci_if_error: true
alt Not cancelled
GH->>Codecov: Upload test results (test-results-action@v1)<br/>inputs: test-report.xml, token<br/>fail_ci_if_error: true
else Cancelled
GH--xCodecov: Skip test-results upload
end
Possibly related PRs
Suggested reviewers
Pre-merge checks✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/ci.yml(1 hunks)src/test/coverage.node.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.node.ts
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Use
*.node.tsfor Desktop-specific implementations that require full file system access and Python environments
Files:
src/test/coverage.node.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Inject interfaces, not concrete classes
Avoid circular dependencies
Usel10n.t()for user-facing strings
Use typed error classes fromsrc/platform/errors/when throwing or handling errors
Use theILoggerservice instead ofconsole.log
Preserve error details while scrubbing PII in messages and telemetry
Include the Microsoft copyright header in source files
Prefer async/await and handle cancellation withCancellationToken
**/*.{ts,tsx}: Order class members (methods, fields, properties) first by accessibility (public/protected/private) and then alphabetically
Do not add the Microsoft copyright header to new files
Use Uri.joinPath() to construct file paths instead of manual string concatenation
Add a blank line after groups of const declarations and before return statements for readability
Separate third-party imports from local file imports
Files:
src/test/coverage.node.ts
🔇 Additional comments (3)
src/test/coverage.node.ts (1)
17-17: LGTM.Adds LCOV reporter for Codecov integration. Matches the CI workflow's expected
coverage/lcov.infopath..github/workflows/ci.yml (2)
95-100: LGTM.Coverage upload correctly uses
fail_ci_if_error: falseand references the LCOV file generated by NYC.
102-108: test-report.xml generation validated. Unittests usemocha-multi-reporterswithmocha-junit-reporter, which by default emitstest-report.xmlat the repo root.
…t results upload - Add VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGE env var to test step to enable coverage generation - Add fail_ci_if_error: false to test results upload for consistency with coverage upload Addresses CodeRabbit automated review feedback on PR #35
Change fail_ci_if_error from false to true for both coverage and test results uploads to ensure CI fails when codecov upload fails, as requested by user.
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 ☂️ |
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
.github/workflows/ci.yml (1)
104-110: Match error handling on test-results upload.Same problem here—Codecov hiccups shouldn’t fail CI. Align this step with the coverage one.
token: ${{ secrets.CODECOV_TOKEN }} files: test-report.xml - fail_ci_if_error: true + fail_ci_if_error: false
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/ci.yml(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). (1)
- GitHub Check: Build & Test
Summary
Adds Codecov integration to vscode-deepnote repository to enable coverage reporting and test results upload, matching the setup implemented in jupyterlab-deepnote.
Changes
lcovreporter to nyc configuration insrc/test/coverage.node.tsto generate codecov-compatible coverage format.github/workflows/ci.yml:codecov/codecov-action@v5codecov/test-results-action@v1fail_ci_if_error: falseto avoid blocking CI if Codecov has issuesPrerequisites
.github/codecov.ymlconfigured with project and patch coverage checksHuman Review Checklist
File paths: Confirm that:
coverage/lcov.info(based onreport-dirconfig)test-report.xmlin repository rootEnvironment setup: Verify
VSC_JUPYTER_INSTRUMENT_CODE_FOR_COVERAGEenvironment variable is set during CI test runs (required for nyc coverage instrumentation)CODECOV_TOKEN: Ensure the secret is configured in repository settings
Integration: Check that adding
lcovreporter doesn't conflict with existing test infrastructureNotes
@deepnote/blockspackage.github/codecov.ymlalready configures project and patch coverage checks, so no additional codecov configuration neededLink to Devin run: https://app.devin.ai/sessions/469dd0ba825c4715b7080a86ea978fcb
Requested by: @jamesbhobbs
Summary by CodeRabbit
Chores
Tests