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
This commit is contained in:
Sam Brannen 2014-03-04 13:18:42 +01:00
parent a60b34fd9e
commit fa44224430
1 changed files with 8 additions and 3 deletions

View File

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