Skip to content

Commit

Permalink
feat(#70): add capability to stop gradle execution if test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
zero88 committed Mar 19, 2024
1 parent 88a0532 commit 969b72d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/kotlin/cloud/playio/gradle/RootProjectPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ class RootProjectPlugin : Plugin<Project>, PluginConstraint {
}
}
named<Test>("test") {
val stopOnTestFailure = prop(project, "stopOnTestFailure", "false").toBoolean()
finalizedBy(ROOT_TEST_REPORT_TASK_NAME)
ignoreFailures = true
ignoreFailures = !stopOnTestFailure
val handler =
KotlinClosure2<TestDescriptor, TestResult, Any>(
{ descriptor, result ->
Expand All @@ -166,7 +167,7 @@ class RootProjectPlugin : Plugin<Project>, PluginConstraint {
})
project.subprojects.map {
it.tasks.withType<Test> {
ignoreFailures = true
ignoreFailures = !stopOnTestFailure
afterTest(handler)
}
}
Expand Down

0 comments on commit 969b72d

Please sign in to comment.