Intelligent Test Runner is supported in dd-java-agent >= 1.18.0.
Setup
Test Visibility setup
Prior to setting up Intelligent Test Runner, set up Test Visibility for Java. If you are reporting data through the Agent, use v6.40+/v7.40+.
UI activation
You, or a user in your organization with “Intelligent Test Runner Activation” permissions, must activate the Intelligent Test Runner on the Test Service Settings page.
Application key and permissions
The Intelligent Test Runner requires an application key mapped to an owner role with the CI Visibility Read (ci_visibility_read) permission.
To enable Intelligent Test Runner, set the following environment variables:
DD_CIVISIBILITY_JACOCO_PLUGIN_VERSION (Optional)
Intelligent Test Runner requires Jacoco for collecting code coverage. Set this variable to a valid Jacoco version (such as 0.8.10) if you want the tracer to run your build with Jacoco injected. Omit it if your project already has Jacoco configured. Default: (empty)
DD_CIVISIBILITY_JACOCO_PLUGIN_INCLUDES (Optional)
Use this variable to configure the list of packages for which code coverage should be collected. While this variable is optional, setting this helps reduce overhead by avoiding coverage collection for core JDK classes and third-party dependencies. Package names should terminate with a * and should be separated with colons: com.myorg.package1.*:com.myorg.package2.*:com.myorg.package3.*
or com.myorg.* (if you have a common root package). Default: (empty)
After setting these environment variables, run your tests as you normally do:
./gradlew cleanTest test --rerun-tasks -Dorg.gradle.jvmargs=\
-javaagent:$DD_TRACER_FOLDER/dd-java-agent.jar=\
dd.civisibility.enabled=true,\
dd.env=ci,\
dd.service=my-java-app