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: 098d7c7465
This commit is contained in:
parent
11ef4308b8
commit
fdac4a7d18
|
|
@ -694,19 +694,23 @@ project("spring-test") {
|
|||
|
||||
task testNG(type: Test) {
|
||||
useTestNG()
|
||||
// forkEvery 1
|
||||
scanForTestClasses = false
|
||||
include "**/testng/*.*"
|
||||
include "**/testng/**/*.*"
|
||||
exclude "**/FailingBeforeAndAfterMethodsTests.class"
|
||||
// "TestCase" classes are run by other test classes, not the build.
|
||||
exclude "**/*TestCase.class"
|
||||
// Generate TestNG reports alongside JUnit reports.
|
||||
testReport true
|
||||
// show standard out and standard error of the test JVM(s) on the console
|
||||
// testLogging.showStandardStreams = true
|
||||
}
|
||||
|
||||
test {
|
||||
dependsOn testNG
|
||||
useJUnit()
|
||||
exclude "**/testng/*.*"
|
||||
exclude "**/testng/**/*.*"
|
||||
include "**/testng/FailingBeforeAndAfterMethodsTests"
|
||||
// "TestCase" classes are run by other test classes, not the build.
|
||||
exclude(["**/*TestCase.class", "**/*TestSuite.class"])
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue