Skip to content

Commit

Permalink
Added plugin for retry tests
Browse files Browse the repository at this point in the history
What's done:
* Added plugin for retry tests
  • Loading branch information
Cheshiriks committed Oct 5, 2021
1 parent e205850 commit 5fdfc32
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ dependencies {
implementation("org.ajoberstar.grgit:grgit-core:4.1.0")
implementation("com.squareup:kotlinpoet:1.8.0")
implementation("com.google.code.gson:gson:2.8.6")
implementation("org.gradle:test-retry-gradle-plugin:1.3.1")
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest
plugins {
kotlin("multiplatform")
kotlin("plugin.serialization")
id("org.gradle.test-retry")
}

kotlin {
Expand Down Expand Up @@ -99,3 +100,11 @@ configurePublishing()
tasks.withType<KotlinJvmTest> {
useJUnitPlatform()
}

tasks.withType<Test> {
retry {
failOnPassedAfterRetry.set(false)
maxFailures.set(10)
maxRetries.set(5)
}
}
2 changes: 1 addition & 1 deletion examples/discovery-test/highlevel/save.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
execCmd = "./detekt"
tags = ["test"]
description = "My description 2"
description = "Test suite"
suiteName = "DocsCheck"

[warn]
Expand Down
2 changes: 1 addition & 1 deletion examples/discovery-test/highlevel/suite2/inner/save.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
execCmd="./ktlint -R diktat-0.4.2.jar"
tags = ["mytags"]
description = "My suite description"
description = "Empty suite"
suiteName = "DocsCheck"

[fix]
Expand Down
2 changes: 1 addition & 1 deletion examples/discovery-test/save.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[general]
execCmd = "./detekt"
tags = ["test"]
description = "My description 1"
description = "All suites"
suiteName = "DocsCheck"

[warn]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ class ConfigDetector(private val fs: FileSystem) {
}
?: run {
logError("Config file was not found in $testConfig")
throw IllegalArgumentException("Provided option '--test-config' $testConfig doesn't correspond" +
" to a valid save.toml file")
throw IllegalArgumentException("Provided directory [$testConfig] doesn't contain" +
" save.toml configuration file")
}
}

Expand Down

0 comments on commit 5fdfc32

Please sign in to comment.