Aggregate JUnit and TestNG test reports

Prior to this commit, the test results for JUnit tests overwrote the
results for TestNG tests in the HTML test report generated by the
Gradle build.

This commit addresses this problem by introducing a new
'aggregateTestReports' task in the spring-test module and making the
'check' task depend on it.

To see aggregated reports in the spring-test module, execute either
`gradle build` or `gradle check`. Executing `gradle test` alone will
not trigger test report aggregation.

Issue: SPR-11509
master
Sam Brannen 11 years ago
parent a60b34fd9e
commit fa44224430
  1. 11
      build.gradle

@ -833,9 +833,7 @@ project("spring-test") {
include(["**/testng/**/*Tests.*", "**/testng/**/*Test.*"]) include(["**/testng/**/*Tests.*", "**/testng/**/*Test.*"])
// "TestCase" classes are run by other test classes, not the build. // "TestCase" classes are run by other test classes, not the build.
exclude(["**/Abstract*.*", "**/*TestCase.class", "**/FailingBeforeAndAfterMethodsTests.class"]) exclude(["**/Abstract*.*", "**/*TestCase.class", "**/FailingBeforeAndAfterMethodsTests.class"])
// Generate TestNG reports alongside JUnit reports. // Show standard out and standard error of the test JVM(s) on the console
getReports().getHtml().setEnabled(true)
// show standard out and standard error of the test JVM(s) on the console
// testLogging.showStandardStreams = true // testLogging.showStandardStreams = true
} }
@ -852,6 +850,13 @@ project("spring-test") {
// itself runs TestNG manually in order to test our TestNG support. // itself runs TestNG manually in order to test our TestNG support.
include "**/testng/FailingBeforeAndAfterMethodsTests" include "**/testng/FailingBeforeAndAfterMethodsTests"
} }
task aggregateTestReports(type: TestReport) {
destinationDir = test.reports.html.destination
reportOn test, testNG
}
check.dependsOn aggregateTestReports
} }
project("spring-aspects") { project("spring-aspects") {

Loading…
Cancel
Save