From fa442244302188695f11b45589aa69c6785a7c57 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 4 Mar 2014 13:18:42 +0100 Subject: [PATCH] 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 --- build.gradle | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index b89cabc3ef..d5807ab38f 100644 --- a/build.gradle +++ b/build.gradle @@ -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") {