The current configuration for Tests tasks requires that a module has Java tests. It's good, of course, because testing is important. But our configuration makes the build complain even if there are tests in Kotlin. Here's the code:
fun TaskContainer.registerTestTasks() {
withType(Test::class.java).configureEach {
filter {
includeTestsMatching("*Test")
includeTestsMatching("*Spec")
}
}
register<FastTest>("fastTest").let {
register<SlowTest>("slowTest") {
shouldRunAfter(it)
}
}
}
There is a workaround for this issue. Creation of a file under test/java/ which does one dummy @Test. It looks ugly, but works.
We need to improve the extension method above so that we can write Kotlin-only tests if we want to.
The current configuration for
Teststasks requires that a module has Java tests. It's good, of course, because testing is important. But our configuration makes the build complain even if there are tests in Kotlin. Here's the code:There is a workaround for this issue. Creation of a file under
test/java/which does one dummy@Test. It looks ugly, but works.We need to improve the extension method above so that we can write Kotlin-only tests if we want to.