DataDog / datadog-ci-rb

Ruby library for Datadog test visibility
https://docs.datadoghq.com/continuous_integration/tests/ruby
Other
8 stars 4 forks source link

[SDTEST-60] Report total lines coverage percentage to Datadog #240

Closed anmarchenko closed 1 month ago

anmarchenko commented 1 month ago

What does this PR do? Adds support for total code coverage reporting feature.

Supported code coverage library: gem "simplecov" >= 0.18.0

Motivation Achieving feature parity across Datadog libraries

How to test the change?

Tested using rubocop project:

image

... and middleman:

image
codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 89.89899% with 10 lines in your changes missing coverage. Please review.

Project coverage is 98.89%. Comparing base (17b2e4f) to head (9b12d3d).

Files with missing lines Patch % Lines
lib/datadog/ci/test_visibility/total_coverage.rb 60.00% 8 Missing :warning:
...b/datadog/ci/contrib/simplecov/result_extractor.rb 88.23% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #240 +/- ## ========================================== - Coverage 98.95% 98.89% -0.07% ========================================== Files 273 279 +6 Lines 13425 13524 +99 Branches 609 620 +11 ========================================== + Hits 13285 13374 +89 - Misses 140 150 +10 ``` | [Flag](https://app.codecov.io/gh/DataDog/datadog-ci-rb/pull/240/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [](https://app.codecov.io/gh/DataDog/datadog-ci-rb/pull/240/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | `98.89% <89.89%> (-0.07%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.