-
Notifications
You must be signed in to change notification settings - Fork 6
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-997] parallel tests gem support #299
Merged
Merged
+3,116
−275
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…s to restore them in worker processes to avoid calling backend API multiple times
…al state in file only when TestSession is going to be distributed
…buted over multiple processes
…tributed test runs
…st session and the test module
f28058e
to
024fadd
Compare
juan-fernandez
approved these changes
Mar 19, 2025
…r test module and they're already present
…rallel_tests, start and stop test suites locally
…meaning of locality
…nimal information required to set test_session_id/test_module_id on other spans
…ext for parallel test runners
…on or its readonly copy)
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Adds proper support for the parallel_tests gem (when used with RSpec): now when running tests with
parallel_rspec
commanddatadog-ci
will trace and report a single test session. Also, the worker processes will now share the remote configuration and other backend data between them, in order to save a lot of time and fire fewer requests to the Datadog's backend.Motivation
When parallel_tests gem is used, we want to report a single test session to correctly calculate time and cost savings from Datadog Test Optimization product
Additional Notes
The most important changes are:
parallel_tests
subfolder incontrib
: it instrumentsParallelTests::CLI
class to start test session and test module when CLI is invokedtest_visibility_drb_server_uri
that is used to propagate DRb (distributed ruby) socket URI between worker processes via ENV variabledatadog-ci
components (Remote, TestVisibility, TestManagement, TestOptimisation) now dump their global state to a file if started under parallel_tests. Worker processes then read this state from a file to avoid going to Datadog backend unnecessary. Seeutils/file_storage.rb
file for the implementation of this storage interface. Seeutils/stateful.rb
for a concern that adds ability to store internal state to any component.How to test the change?

Manual testing using anmarchenko/rubocop project, results:
Added unit tests to make sure that
ParallelTests::CLI
opens test_session and test_module