Test Impact Analysis is supported in dd-java-agent >= 1.27.0.
The following test frameworks are supported:
JUnit >= 4.10 and >= 5.3
TestNG >= 6.4
Spock >= 2.0
Cucumber >= 5.4.0
Karate >= 1.0.0
Scalatest >= 3.0.8
Setup
Test Optimization
Prior to setting up Test Impact Analysis, set up Test Optimization for Java. If you are reporting data through the Agent, use v6.40 and later or v7.40 and later.
Activate Test Impact Analysis for the test service
You, or a user in your organization with the Intelligent Test Runner Activation (intelligent_test_runner_activation_write) permission, must activate Test Impact Analysis on the Test Service Settings page.
Run tests with Test Impact Analysis enabled
After completing setup, run your tests as you normally do:
./gradlew cleanTest test -Dorg.gradle.jvmargs=\
-javaagent:$DD_TRACER_FOLDER/dd-java-agent.jar=\
dd.civisibility.enabled=true,\
dd.env=ci,\
dd.service=my-java-app
You can override the Test Impact Analysis behavior and prevent specific tests from being skipped. These tests are referred to as unskippable tests.
Why make tests unskippable?
Test Impact Analysis uses code coverage data to determine whether or not tests should be skipped. In some cases, this data may not be sufficient to make this determination.
Examples include:
Tests that read data from text files
Tests that interact with APIs outside of the code being tested (such as remote REST APIs)
Designating tests as unskippable ensures that Test Impact Analysis runs them regardless of coverage data.
Compatibility
Unskippable tests are supported in the following versions and testing frameworks:
JUnit >= 4.10 and >= 5.3
TestNG >= 6.4
Spock >= 2.2
Cucumber >= 5.4.0
Scalatest >= 3.0.8
Marking tests as unskippable
Individual test case
Add a JUnit Tag with the value datadog_itr_unskippable to your test case to mark it as unskippable.
Add a JUnit Category with the value datadog_itr_unskippable to your test case to mark it as unskippable.
You do not have to create the datadog_itr_unskippable for every test case or test suite, one category is enough for the entire project.
Add a JUnit Tag with the value datadog_itr_unskippable to your test suite to mark it as unskippable.
You do not have to create the datadog_itr_unskippable for every test case or test suite, one category is enough for the entire project.
If a suite is marked as unskippable, none of the test cases from that suite can be skipped by Test Impact Analysis.