Add Datadog code coverage upload#2773
Conversation
Side-by-side coverage reporting: adds Datadog coverage upload alongside existing Codecov upload using DataDog/coverage-upload-github-action. Co-Authored-By: Claude Opus 4.6 <[email protected]>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4d91dbbb6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| continue-on-error: true | ||
| uses: DataDog/coverage-upload-github-action@v1 | ||
| with: | ||
| api_key: ${{ secrets.DD_API_KEY }} | ||
| files: . |
There was a problem hiding this comment.
Avoid uploading partial coverage from failed test runs
With if: always() and files: ., this step still runs after a failed make test and recursively uploads any report it can find. In this repo, gotest writes cover.out before integration-tests writes cover_integration.out (Makefile:201-209), so an integration-test failure will leave only the unit-test profile on disk. The existing Codecov step above stays on the default success() path, so Datadog will record partial coverage for red builds while Codecov records nothing, which undermines the parity comparison this change is trying to establish.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Removed if: always() so that upload only happens when both gotest and integration-tests pass, which matches more with the codecov behavior: 3345e25
Pin DataDog/coverage-upload-github-action@v1 to commit SHA d2cf302a39c05e0ad22063360a2bf6ce0cc4906c for supply chain security. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2773 +/- ##
=======================================
Coverage 38.81% 38.81%
=======================================
Files 309 309
Lines 26803 26803
=======================================
Hits 10404 10404
Misses 15620 15620
Partials 779 779
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Copying from #2750
What does this PR do?
We're migrating Datadog repositories from Codecov to Datadog Code Coverage for tracking test coverage. This PR is the first step: it adds a Datadog coverage upload alongside the existing Codecov upload so we can run both systems in parallel and verify parity before switching over.
Changes
DataDog/coverage-upload-github-action@v1step to thebuildjob inmain.yml, running after the existing Codecov uploadcover.outandcover_integration.outwith theunittestsflag (mirroring Codecov)if: always()andcontinue-on-error: trueso it cannot block CIWhy are we doing this?
As part of a company-wide effort, we're consolidating code coverage reporting into Datadog's own Code Coverage product. This gives us:
Validation
Pending — the Datadog upload requires
DD_API_KEYwhich is not available to fork PRs. Coverage comparison will be possible after merge or when CI runs from the base repo.Next steps (not in this PR)
Once this PR is merged and we've confirmed Datadog coverage is stable over several commits:
CODECOV_TOKENsecretcode-coverage.datadog.ymlNo action needed from reviewers beyond normal review
This is a low-risk, additive change. The new upload step runs independently of the existing CI pipeline and cannot cause test failures.