Skip to content

Commit 52574bc

Browse files
committed
Add org.gradle.test-retry plugin to build.gradle.kts to automatically rerun flacky integration tests
1 parent f0592e3 commit 52574bc

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

build.gradle.kts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ plugins {
1313
id("nebula.release") version "15.2.0"
1414
id("maven-publish")
1515
id("io.gitlab.arturbosch.detekt") version "1.17.1"
16+
id("org.gradle.test-retry") version "1.4.1"
1617
}
1718

1819
repositories {
@@ -57,6 +58,9 @@ tasks.withType<Test> {
5758
slowThreshold = Consts.SLOW_TESTS_LOGGING_THRESHOLD_MS
5859
theme = ThemeType.STANDARD
5960
}
61+
retry {
62+
maxRetries.set(Consts.MAX_TEST_RETRIES_COUNT)
63+
}
6064
}
6165

6266
tasks.withType<Detekt>().configureEach {
@@ -66,7 +70,6 @@ tasks.withType<Detekt>().configureEach {
6670
val settingsProvider = SettingsProvider()
6771

6872
tasks {
69-
7073
// All checks were already made by workflow "On pull request" => no checks here
7174
if (gradle.startParameter.taskNames.contains("final")) {
7275
named("build").get().apply {
@@ -324,6 +327,6 @@ object PublicationSettings {
324327
}
325328

326329
object Consts {
327-
328330
const val SLOW_TESTS_LOGGING_THRESHOLD_MS = 30_000L
331+
const val MAX_TEST_RETRIES_COUNT = 3
329332
}

0 commit comments

Comments
 (0)