Skip to content

Commit 098d7c7

Browse files
committed
Ensure all tests in spring-test are executed
Prior to this commit TestNG tests would only be executed by the Gradle build if they were located in the “testng” package. Tests in subpackages would therefore be omitted from the build. This commit ensures that all TestNG classes in the “testng” package and any of its subpackages are executed in the Gradle build. Furthermore, this commit ensures that the JUnit-based FailingBeforeAndAfterMethodsTests test class is executed along with the other JUnit tests even though it resides under the “testng” package. Issue: SPR-11338
1 parent 4a569e6 commit 098d7c7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -826,19 +826,23 @@ project("spring-test") {
826826

827827
task testNG(type: Test) {
828828
useTestNG()
829+
// forkEvery 1
829830
scanForTestClasses = false
830-
include "**/testng/*.*"
831+
include "**/testng/**/*.*"
831832
exclude "**/FailingBeforeAndAfterMethodsTests.class"
832833
// "TestCase" classes are run by other test classes, not the build.
833834
exclude "**/*TestCase.class"
834835
// Generate TestNG reports alongside JUnit reports.
835836
getReports().getHtml().setEnabled(true)
837+
// show standard out and standard error of the test JVM(s) on the console
838+
// testLogging.showStandardStreams = true
836839
}
837840

838841
test {
839842
dependsOn testNG
840843
useJUnit()
841-
exclude "**/testng/*.*"
844+
exclude "**/testng/**/*.*"
845+
include "**/testng/FailingBeforeAndAfterMethodsTests"
842846
// "TestCase" classes are run by other test classes, not the build.
843847
exclude(["**/*TestCase.class", "**/*TestSuite.class"])
844848
}

0 commit comments

Comments
 (0)