Skip to content

Commit

Permalink
feat: add automatic test retries
Browse files Browse the repository at this point in the history
  • Loading branch information
ttypic committed Oct 3, 2024
1 parent d685ae7 commit 0718012
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
alias(libs.plugins.android.library) apply false
alias(libs.plugins.maven.publish) apply false
alias(libs.plugins.lombok) apply false
alias(libs.plugins.test.retry) apply false
}

subprojects {
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ android-retrostreams = "1.7.4"
maven-publish = "0.29.0"
lombok = "8.10"
okhttp = "4.12.0"
test-retry = "1.6.0"

[libraries]
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
Expand Down Expand Up @@ -51,3 +52,4 @@ android-library = { id = "com.android.library", version.ref = "agp" }
build-config = { id = "com.github.gmazzo.buildconfig", version.ref = "build-config" }
maven-publish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
lombok = { id = "io.freefair.lombok", version.ref = "lombok" }
test-retry = { id = "org.gradle.test-retry", version.ref = "test-retry" }
13 changes: 13 additions & 0 deletions java/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
plugins {
alias(libs.plugins.build.config)
alias(libs.plugins.maven.publish)
alias(libs.plugins.test.retry)
checkstyle
`java-library`
}
Expand Down Expand Up @@ -63,6 +64,12 @@ tasks.register<Test>("testRealtimeSuite") {
testLogging {
exceptionFormat = TestExceptionFormat.FULL
}
retry {
maxRetries.set(2)
maxFailures.set(4)
failOnPassedAfterRetry.set(false)
failOnSkippedAfterRetry.set(false)
}
}

tasks.register<Test>("testRestSuite") {
Expand All @@ -76,6 +83,12 @@ tasks.register<Test>("testRestSuite") {
testLogging {
exceptionFormat = TestExceptionFormat.FULL
}
retry {
maxRetries.set(2)
maxFailures.set(4)
failOnPassedAfterRetry.set(false)
failOnSkippedAfterRetry.set(false)
}
}

/*
Expand Down

0 comments on commit 0718012

Please sign in to comment.