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

Java: log failed tests #2390

Merged
merged 1 commit into from
Oct 7, 2024
Merged
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
No commit message
Yury-Fridlyand committed Oct 4, 2024
commit c502917a1789d7f10002fab5213300e9887c8eb3
18 changes: 18 additions & 0 deletions java/build.gradle
Original file line number Diff line number Diff line change
@@ -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)