Skip to content

Add Datadog code coverage upload#3255

Merged
0xnm merged 1 commit into
developfrom
add-datadog-coverage
Mar 12, 2026
Merged

Add Datadog code coverage upload#3255
0xnm merged 1 commit into
developfrom
add-datadog-coverage

Conversation

@ManuelPalenzuelaDD

Copy link
Copy Markdown
Contributor

What

This PR adds Datadog Code Coverage reporting alongside the existing Codecov integration. It's part of a company-wide initiative to migrate all DataDog repositories from Codecov to our own Code Coverage product.

Nothing is removed — Codecov continues to work exactly as before. This PR only adds a Datadog upload so we can run both systems side-by-side and verify coverage parity before fully switching over.

Why

Datadog Code Coverage is our in-house replacement for Codecov. It integrates natively with CI Visibility, provides PR comments and coverage gates, and removes the dependency on a third-party service. All DataDog repositories are being migrated.

Changes

1. ci/pipelines/default-pipeline.yml

Added two lines to the test:kover job, after the existing Codecov upload:

- npm install -g @datadog/datadog-ci
- datadog-ci coverage upload --format=jacoco . || true
  • Installs the datadog-ci CLI and uploads all Kover XML (JaCoCo format) reports to Datadog
  • Uses the existing DD_API_KEY already set in this job (from Vault via DD_ANDROID_SECRET__API_KEY)
  • || true ensures the upload is non-blocking — if it fails for any reason, the build still passes

2. code-coverage.datadog.yml (new file)

Configuration for Datadog Code Coverage, equivalent to your existing .codecov.yml:

schema-version: v1
ignore:
  - "build/"
  - "**/build/"
  - "**/src/test/"

These ignore paths mirror what's already in .codecov.yml (build, .*/build/.*, .*/src/test/.*).

Validation

We compared coverage on the same commit (b94905c2 on develop) in both systems:

System Overall Coverage
Codecov 71.39%
Datadog 71.42%
Difference +0.03%

Coverage parity is confirmed — the difference is negligible.

Impact

  • Zero risk to existing CI: Codecov upload is untouched, and the Datadog upload is non-blocking (|| true)
  • No new secrets needed: DD_API_KEY is already available in the test:kover job
  • No behavior changes: This only adds an extra upload step after tests complete

Next Steps (not part of this PR)

Once we've confirmed everything works in production for a few cycles, a follow-up PR will:

  1. Remove the Codecov upload step and .codecov.yml
  2. Optionally configure PR Gates (coverage thresholds) in code-coverage.datadog.yml

If you have any questions about Datadog Code Coverage, see the docs or reach out to us.

Side-by-side coverage reporting: adds Datadog coverage upload alongside
existing Codecov upload in the test:kover GitLab CI job. Also adds
code-coverage.datadog.yml with ignore paths matching .codecov.yml.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@ManuelPalenzuelaDD
ManuelPalenzuelaDD marked this pull request as ready for review March 12, 2026 17:04
@ManuelPalenzuelaDD
ManuelPalenzuelaDD requested review from a team as code owners March 12, 2026 17:04
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.39%. Comparing base (f2674e0) to head (92f9842).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3255      +/-   ##
===========================================
+ Coverage    71.35%   71.39%   +0.04%     
===========================================
  Files          940      940              
  Lines        34764    34764              
  Branches      5893     5893              
===========================================
+ Hits         24805    24819      +14     
+ Misses        8312     8290      -22     
- Partials      1647     1655       +8     

see 44 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@0xnm
0xnm merged commit 79caf0b into develop Mar 12, 2026
28 checks passed
@0xnm
0xnm deleted the add-datadog-coverage branch March 12, 2026 18:20
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.

4 participants