-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SDTEST-408] multi threaded code coverage support for datadog_cov #189
[SDTEST-408] multi threaded code coverage support for datadog_cov #189
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #189 +/- ##
==========================================
+ Coverage 98.85% 98.86% +0.01%
==========================================
Files 228 229 +1
Lines 10082 10172 +90
Branches 465 468 +3
==========================================
+ Hits 9967 10057 +90
Misses 115 115 ☔ View full report in Codecov by Sentry. |
b3db6ae
to
0da2baa
Compare
8c3bf11
to
305174a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Seems reasonable!
Given that dd-trace-rb also has a bunch of background threads, would it make sense to exclude them by default?
E.g. by looking at their names for instance (all of our threads should be named with the Datadog::
prefix).
… by multithreading code coverage
…riable to switch to single threaded code coverage mode if needed
305174a
to
18edce6
Compare
4ab5804
to
573eeda
Compare
… one that started it
What does this PR do?
Fixes an issue when per test code coverage for ITR ignored background threads. This led to the coverage being incomplete in the most cases as Rails uses threading for background jobs testing for example.
Now by default code coverage is collected for all threads, not only the current thread of the test. I added a parameter that will allow the library to switch back to track single thread in a less probable situation where threaded parallel test runner is used.
Motivation
Reports of incomplete code coverage when running Rails tests
Additional notes
This is built on top of PR that improves code coverage tool performance: #171
How to test the change?
Unit tests are provided