Skip to content

Commit

Permalink
Java: log failed tests (#2390)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yury-Fridlyand authored Oct 7, 2024
1 parent 109b5ba commit 60e0228
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,24 @@ subprojects {
// TODO: add jacoco with code coverage
// finalizedBy jacocoTestReport, jacocoTestCoverageVerification
}

ext.failedTests = []

tasks.withType(Test) {
afterTest { TestDescriptor descriptor, TestResult result ->
if (result.resultType == TestResult.ResultType.FAILURE) {
failedTests << "${descriptor.className}.${descriptor.name}"
}
}
}

gradle.buildFinished {
if (!failedTests.empty) {
println "\nFailed tests for `:${project.name}`:"
failedTests.each { failedTest -> println failedTest }
println ""
}
}
}

// JaCoCo section (code coverage by unit tests)
Expand Down

0 comments on commit 60e0228

Please sign in to comment.