Skip to content

Commit

Permalink
Add test-retry plugin (#5586)
Browse files Browse the repository at this point in the history
* Enable the plugin only in CI environment
* Every test will retry up to 2 times. 3 runs per test in general
* Disable retry if 5 tests (no retries are count) fail
  • Loading branch information
eddumelendez committed Jul 8, 2022
1 parent 2f3178d commit 84d3444
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'me.champeau.gradle.japicmp' version '0.2.9' apply false
id 'com.diffplug.spotless' version '6.3.0' apply false
id 'org.gradle.test-retry' version '1.4.0'
}

apply from: "$rootDir/gradle/ci-support.gradle"
Expand All @@ -33,6 +34,7 @@ subprojects {
apply from: "$rootDir/gradle/shading.gradle"
apply plugin: 'com.diffplug.spotless'
apply plugin: 'checkstyle'
apply plugin: 'org.gradle.test-retry'

group = "org.testcontainers"

Expand Down Expand Up @@ -86,6 +88,14 @@ subprojects {
exceptionFormat = 'full'
events "STARTED", "PASSED", "FAILED", "SKIPPED"
}
ext.isCI = System.getenv("CI") != null
if (isCI) {
retry {
maxRetries = 2
maxFailures = 5
failOnPassedAfterRetry = false
}
}
}

tasks.withType(Test).all {
Expand Down

0 comments on commit 84d3444

Please sign in to comment.