Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added plugin for retry tests #285

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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