I am using JUnit 4.13.1 and TestNg 6.14.3 in the same gradle project(Jenkins Plugin). One class has TestNg unit tests and other has JUnit unit tests. For me both are not working together.
If I use this config in build.gradle
then only JUnit works
test {
testLogging {
showStandardStreams = true
}
doFirst {
environment 'OUTPUT_DIR', project.buildDir
systemProperty 'build.notifications.disabled', 'true'
}
useTestNG()
useJUnit()
}
And if I use this config or remove useJUnit() then only JUnit works.
test {
testLogging {
showStandardStreams = true
}
doFirst {
environment 'OUTPUT_DIR', project.buildDir
systemProperty 'build.notifications.disabled', 'true'
}
useJUnit()
}
If I keep only useTestNG() then only TestNG works.
What is the proper configuration for both to run in same gradle project? The error I get -
Execution failed for task ':test'.
> No tests found for given includes: [com.build.plugins.TestDataTest](--tests filter)