Intelligent Test Runner is only supported on dd-trace>= 2.22.0 (execute dd-trace --version to get the version of the tool).
Setup
Test Visibility
Prior to setting up Intelligent Test Runner, set up Test Visibility for .NET. If you are reporting data through the Agent, use v6.40 and later or v7.40 and later.
Activate Intelligent Test Runner 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 the Intelligent Test Runner on the Test Service Settings page.
Run tests with the Intelligent Test Runner enabled
dd-trace ci run --dd-service=my-dotnet-app --dd-env=ci -- dotnet test
dd-trace ci run --dd-service=my-dotnet-app --dd-env=ci -- VSTest.Console.exe {test_assembly}.dll
Disable skipping for specific tests
You can override the Intelligent Test Runner’s behavior and prevent specific tests from being skipped. These tests are referred to as unskippable tests.
Why make tests unskippable?
The Intelligent Test Runner 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 the Intelligent Test Runner runs them regardless of coverage data.
Marking tests as unskippable
Individual test case
Add a XUnit TraitAttribute with the key datadog_itr_unskippable to your test case to mark it as unskippable.
Add a NUnit PropertyAttribute with the key datadog_itr_unskippable and a non-null value (for example, string.Empty) to your test case to mark it as unskippable.
Add a NUnit PropertyAttribute with the key datadog_itr_unskippable and a non-null value (for example, string.Empty) to your test suite to mark it as unskippable.
If a suite is marked as unskippable, none of the test cases from that suite can be skipped by ITR.