Cette page n'est pas encore disponible en français, sa traduction est en cours. Si vous avez des questions ou des retours sur notre projet de traduction actuel, n'hésitez pas à nous contacter.
Prior to setting up Test Impact Analysis, set up Test Optimization for Python. If you are reporting data through the Agent, use v6.40 and later or v7.40 and later.
Pour activer la fonctionnalité Test Impact Analysis, accédez à la page Test Service Settings. Vous devez disposer de l’autorisation d’activation d’Intelligent Test Runner (intelligent_test_runner_activation_write).
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.
You can use pytest’s skipif mark to prevent Test Impact Analysis from skipping individual tests or modules. Specify the condition as False, and the reason as "datadog_itr_unskippable".
You can use unittest’s skipif mark to prevent Test Impact Analysis from skipping individual tests. Specify the condition as False, and the reason as "datadog_itr_unskippable".
Coverage data may appear incomplete when Test Impact Analysis is enabled. Lines of code that would normally be covered by tests are not be covered when these tests are skipped.
Test Impact Analysis uses the coverage package’s API to collect code coverage. Data from coverage run or plugins like pytest-cov is incomplete as a result of ddtrace’s use of the Coverage class.
Some race conditions may cause exceptions when using pytest plugins such as pytest-xdist that change test execution order or introduce parallelization.