DataDog / datadog-ci-rb

Ruby library for Datadog Test Optimization
https://docs.datadoghq.com/tests/setup/ruby/?tab=cloudciprovideragentless
Other
11 stars 4 forks source link

[SDTEST-786] support logical names for test sessions #235

Closed anmarchenko closed 2 months ago

anmarchenko commented 2 months ago

What does this PR do? Adds support for the logical test session names for test visibility.

Now users are able to name their test sessions using DD_TEST_SESSION_NAME variable. If the environment variable is not provided, "#{ci_job_name}-#{test_command}" is used as default.

Motivation Currently test sessions suffer from unstable fingerprints issue: we use the full test command as the test session identifier right now, and test command might have some random bits (like seed for example). This makes every test session to be considered new by the Datadog's backend, and breaks some features - for example, ITR savings calculation.

This is the first step to migrate to the new definition of test session name.

How to test the change? Unit tests are provided

Tested using sidekiq project on production:

image image
codecov-commenter commented 2 months ago

Codecov Report

Attention: Patch coverage is 98.86364% with 1 line in your changes missing coverage. Please review.

Project coverage is 98.95%. Comparing base (0fc0203) to head (96c32c7).

Files with missing lines Patch % Lines
lib/datadog/ci/test_visibility/null_component.rb 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #235 +/- ## ========================================== - Coverage 98.95% 98.95% -0.01% ========================================== Files 273 273 Lines 13285 13368 +83 Branches 597 600 +3 ========================================== + Hits 13146 13228 +82 - Misses 139 140 +1 ```

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