= Develocity Testing Annotations
Common annotations for https://gradle.com/[Develocity]'s https://docs.gradle.com/enterprise/predictive-test-selection/[Predictive Test Selection] and https://docs.gradle.com/enterprise/test-distribution/[Test Distribution] as well as the standalone https://github.com/gradle/test-retry-gradle-plugin[Test Retry Plugin].
== Annotations
All annotations have an optional because
attribute to explain why the annotation is present.
The annotations are located in the com.gradle.develocity.testing.annotations
package.
=== Predictive Test Selection
@MustRun
- indicates that the test must be run.=== Test Distribution
@LocalOnly
- indicates that the test must be run locally.@RemoteOnly
- indicates that the test must be run remotely.=== Test Retry Plugin
@Retryable
- indicates that the test should be retried.@NonRetryable
- indicates that the test must not be retried.@ClassRetry
- indicates that the test class must be retried as a whole unit== Usage
== Configuration
=== Predictive Test Selection
The Develocity Gradle plugin version 3.16 or higher has built-in support for the @MustRun
annotation.
For Gradle see https://docs.gradle.com/enterprise/predictive-test-selection/#must_run_annotation_matcher[Must Run Annotation Matcher] chapter for details.
The Develocity Maven extension version 1.20 or higher has built-in support for the @MustRun
annotation.
For Maven see the https://docs.gradle.com/enterprise/predictive-test-selection/#must_run_annotation_matcher_2[Must Run Annotation Matcher] chapter for details.
=== Test Distribution The Develocity Gradle plugin version 3.16 or higher has built-in support for these annotations.
For Gradle see https://docs.gradle.com/enterprise/test-distribution/#gradle_executor_restrictions_annotation_matcher[Local-/remote-only annotation matcher] chapter for details.
The Develocity Maven extension version 1.20 or higher has built-in support for these annotations.
For Maven see the https://docs.gradle.com/enterprise/test-distribution/#maven_executor_restrictions_annotation_matcher[Local-/remote-only annotation matcher] chapter for details.
=== Test Retry Plugin See the https://github.com/gradle/test-retry-gradle-plugin#filtering[Filtering] chapter for details.
@NonRetryable
will be retried if it fails.==== Opt-in mode
With this configuration only the classes annotated with @Retryable
will be retried if they fail.
==== Retry on class-level (since 1.1)
By default, individual tests are retried.
The classRetry component of the test retry extension can be used to control which test classes must be retried as a whole unit.
Test classes still have to pass the configured filter, as this annotation does not imply @Retryable
by default.
The Test Retry Gradle plugin version 1.5.0 or higher has built-in support for @ClassRetry
.
===== Combining with Opt-in mode
You can also combine configure @ClassRetry
act as opt-in marker.