Skip to content

Commit fdac4a7

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 Backport-Commit: 098d7c7
1 parent 11ef430 commit fdac4a7

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
@@ -694,19 +694,23 @@ project("spring-test") {
694694

695695
task testNG(type: Test) {
696696
useTestNG()
697+
// forkEvery 1
697698
scanForTestClasses = false
698-
include "**/testng/*.*"
699+
include "**/testng/**/*.*"
699700
exclude "**/FailingBeforeAndAfterMethodsTests.class"
700701
// "TestCase" classes are run by other test classes, not the build.
701702
exclude "**/*TestCase.class"
702703
// Generate TestNG reports alongside JUnit reports.
703704
testReport true
705+
// show standard out and standard error of the test JVM(s) on the console
706+
// testLogging.showStandardStreams = true
704707
}
705708

706709
test {
707710
dependsOn testNG
708711
useJUnit()
709-
exclude "**/testng/*.*"
712+
exclude "**/testng/**/*.*"
713+
include "**/testng/FailingBeforeAndAfterMethodsTests"
710714
// "TestCase" classes are run by other test classes, not the build.
711715
exclude(["**/*TestCase.class", "**/*TestSuite.class"])
712716
}

0 commit comments

Comments
 (0)