Skip to content

Commit

Permalink
Merge pull request #161 from gradle/snoopcheri/update-documentation
Browse files Browse the repository at this point in the history
Update documentation
  • Loading branch information
snoopcheri committed Nov 30, 2022
2 parents 9dc2be1 + b503cd4 commit 3c77d13
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
69 changes: 69 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,53 @@ public interface TestRetryTaskExtension {
}
/**
* The set of criteria specifying which test classes must be retried as a whole unit
* if retries are enabled and the test class passes the configured filter.
*/
ClassRetryCriteria getClassRetry();
/**
* The set of criteria specifying which test classes must be retried as a whole unit
* if retries are enabled and the test class passes the configured filter.
*/
void classRetry(Action<? super ClassRetryCriteria> action);
/**
* The set of criteria specifying which test classes must be retried as a whole unit
* if retries are enabled and the test class passes the configured filter.
*/
interface ClassRetryCriteria {
/**
* The patterns used to include tests based on their class name.
*
* The pattern string matches against qualified class names.
* It may contain '*' characters, which match zero or more of any character.
*
* A class name only has to match one pattern to be included.
*
* If no patterns are specified, all classes (that also meet other configured filters) will be included.
*/
SetProperty<String> getIncludeClasses();
/**
* The patterns used to include tests based on their class level annotations.
*
* The pattern string matches against the qualified class names of a test class's annotations.
* It may contain '*' characters, which match zero or more of any character.
*
* A class need only have one annotation matching any of the patterns to be included.
*
* Annotations present on super classes that are {@code @Inherited} are considered when inspecting subclasses.
*
* If no patterns are specified, all classes (that also meet other configured filters) will be included.
*/
SetProperty<String> getIncludeAnnotationClasses();
}
}
----

Expand Down Expand Up @@ -316,6 +363,28 @@ test {
}
----

== Retry on class-level

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.

.build.gradle:
[source,groovy]
----
test {
retry {
maxRetries = 3
classRetry {
// configure by qualified class name (* matches zero or more of any character)
includeClasses.add("*StepWiseIntegrationTest")
// configure by class level annotations
// Note: @Inherited annotations are respected
includeAnnotationClasses("Stepwise")
}
}
}
----

== Reporting

=== Gradle
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-8.0-20221123073956+0000-bin.zip
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-8.0-20221130035948+0000-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 3c77d13

Please sign in to comment.