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-666] RSpec - don't report test errors if rspec process is quitting #215

Closed anmarchenko closed 2 months ago

anmarchenko commented 2 months ago

What does this PR do? When rspec process is being killed by INT signal, it still runs the current test until the end. If some resources (e.g. databases) are being decomissioned before the test ends, then datadog-ci traces this error and sends it to the backend. This might create noise for the users because of irrelevant errors.

This PR checks RSpec.world.wants_to_quit variable after running each test. If RSpec is quitting, we do not set error for the current span.

Motivation Customer reports that datadog-ci reports test failures when infrastructure (db) is down after CI job is canceled .

How to test the change? Unit test is provided