Implement automatic Test Optimization instrumentation for Ruby projects#476
Conversation
|
Could you please also update the list of languages at https://docs.datadoghq.com/continuous_integration/pipelines/jenkins/?tab=agentlessusinganapikey#enable-test-optimization (In the section where |
| listener.getLogger().println("[datadog] Configuring DD Ruby tracer: got bundler version " + bundlerVersion + " from " + workspacePath + " on " + node); | ||
|
|
||
| String rubygemsVersion = workspacePath.act(new ShellCommandCallable(Collections.emptyMap(), GET_VERSION_TIMEOUT_MILLIS, "gem", "-v")); | ||
| listener.getLogger().println("[datadog] Configuring DD Ruby tracer: got rubygems version " + rubygemsVersion + " from " + workspacePath + " on " + node); |
There was a problem hiding this comment.
Why are we not checking the versions that we get? Is the idea that as long as the command doesn't fail it should be enough?
There was a problem hiding this comment.
good point, in the script I check versions, here I forgot to do that because other Jenkins configurations don't check versions
|
There are some sample pipelines for different languages at That'd require adding a Ruby agent in |
Co-authored-by: Nikita Tkachenko <[email protected]>
… Rubygems versions
Requirements for Contributing to this repository
What does this PR do?
Adds automatic test optimization tracer configuration for Ruby projects.
Description of the Change
The change is done similarly to #400
RubyConfigurationclass that checks versions forruby,gem,bundletools available in the workspace. Afterwards it executesbundle config set frozen falseto unfreeze the dependencies (required to add a new dependency, tracer in this case). Thenbundle add datadog-cicommand is executed to add the latest version of test optimization library. The configurator returnsRUBYOPTenvironment variable with-rbundler/setup -rdatadog/ci/auto_instrument- this will tell Ruby VM to load Datadog's code before running tests.Alternate Designs
N/A
Possible Drawbacks
N/A
Verification Process
Verified using docker compose setup for manual testing
Step 1: start jenkins on docker compose
Step 2: run test-pipeline-ruby without test optimization
Step 3: configure Test Optimization for test-pipeline-ruby
Step 4: run test-pipeline-ruby with Datadog plugin and auto innjection
Step 5: validate that tests are present in Datadog
Additional Notes
N/A
Release Notes
N/A
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.