Open
Description
I'm having trouble running a custom test task on the classpath. The custom task is used to enable TestNG, which only a portion of the tests use. This is the relevant portion of my build file:
test {
moduleOptions { // Ok
runOnClasspath = true
}
useJUnitPlatform()
testLogging {
events = ['skipped', 'failed']
showStandardStreams = true
}
}
task tckTests(type: Test) {
moduleOptions { // Causes problems
runOnClasspath = true
}
useTestNG()
testLogging {
events = ['skipped', 'failed']
showStandardStreams = true
}
mustRunAfter(':test')
}
Error:
Could not find method moduleOptions() for arguments [build_d4flzour41wmm2m64le5sxrq5$_run_closure4$_closure7@1825ba81] on task ':tckTests' of type org.gradle.api.tasks.testing.Test.
It also doesn't work when I instead try to configure tasks with type Test
:
tasks.withType(Test) {
moduleOptions {
runOnClasspath = true
}
testLogging {
events = ['skipped', 'failed']
showStandardStreams = true
}
}
Am I doing anything wrong or this is a limitation in the plugin ?