Ensure spring-test test tasks are UP-TO-DATE

Prior to this commit, the three `test` tasks in the spring-test module
shared the same output directory for test reports. This had the
negative side effect of causing Gradle to believe that the tasks were
not UP-TO-DATE. Consequently, all three `test` tasks in the spring-test
module were executed for every build even if there were zero changes in
the spring-test module.

This commit fixes this issue by allowing Gradle to use the default test
results output directory for each `test` task. Thanks to @marcphilipp
for providing the tip.

In addition, the Artifactory Gradle task in the Default Job of the
Bamboo build plan for the Spring Framework (SPR-PUB) has been updated
to use the following custom test results directory pattern:
`**/build/test-results/**/*.xml`.

See: https://guides.gradle.org/using-build-cache/#concepts_overlapping_outputs
master
Sam Brannen 6 years ago
parent 7e6a5f5875
commit eec183ef28
  1. 3
      spring-test/spring-test.gradle

@ -95,7 +95,6 @@ task testNG(type: Test) {
// Show STD_OUT & STD_ERR of the test JVM(s) on the console: // Show STD_OUT & STD_ERR of the test JVM(s) on the console:
// testLogging.showStandardStreams = true // testLogging.showStandardStreams = true
// forkEvery 1 // forkEvery 1
reports.junitXml.destination = file("$buildDir/test-results")
} }
task testJUnitJupiter(type: Test) { task testJUnitJupiter(type: Test) {
@ -107,7 +106,6 @@ task testJUnitJupiter(type: Test) {
filter { filter {
includeTestsMatching "org.springframework.test.context.junit.jupiter.*" includeTestsMatching "org.springframework.test.context.junit.jupiter.*"
} }
reports.junitXml.destination = file("$buildDir/test-results")
// Java Util Logging for the JUnit Platform. // Java Util Logging for the JUnit Platform.
// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager") // systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
} }
@ -119,7 +117,6 @@ test {
scanForTestClasses = false scanForTestClasses = false
include(["**/*Tests.class", "**/*Test.class"]) include(["**/*Tests.class", "**/*Test.class"])
exclude(["**/testng/**/*.*", "**/jupiter/**/*.*"]) exclude(["**/testng/**/*.*", "**/jupiter/**/*.*"])
reports.junitXml.destination = file("$buildDir/test-results")
} }
task aggregateTestReports(type: TestReport) { task aggregateTestReports(type: TestReport) {

Loading…
Cancel
Save