dave08
08/22/2021, 11:18 AMTobi M.
08/22/2021, 11:24 AM./gradlew :<module-name>:test
to just run the tests in one module.dave08
08/22/2021, 11:25 AMsam
08/22/2021, 11:30 AM./gradlew check
or /.gradlew test
at the top leveldave08
08/22/2021, 11:31 AMsam
08/22/2021, 11:31 AMdave08
08/22/2021, 11:36 AMsam
08/22/2021, 11:36 AMdave08
08/22/2021, 11:38 AMplugins {
kotlin("jvm")
kotlin("kapt")
id("com.squareup.anvil")
}
Big Chungus
08/22/2021, 11:40 AMallprojects {
afterEvaluate {
tasks {
if (tasks.findByName("test") == null) {
register("test") {
dependsOn(withType(KotlinTest::class))
group = "verification"
}
}
}
}
}
./gradlew test
will run all tests in all modules, regardless if it's a jvm or mpp modulesam
08/22/2021, 11:41 AMdave08
08/22/2021, 11:41 AMsam
08/22/2021, 11:42 AMcheck
task.tasks.named<Test>("jvmTest") {
useJUnitPlatform()
filter {
isFailOnNoMatchingTests = false
}
testLogging {
showExceptions = true
showStandardStreams = true
events = setOf(
org.gradle.api.tasks.testing.logging.TestLogEvent.FAILED,
org.gradle.api.tasks.testing.logging.TestLogEvent.PASSED
)
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
}
}
dave08
08/22/2021, 11:44 AMKotlinTest::class
or
KoTest::class
?
And @sam, that does the same as what he posted?sam
08/22/2021, 11:44 AMBig Chungus
08/22/2021, 11:45 AM./gradlew test
to execute all your modules, use my suggestion above. I cannot comment on kotest plugin.dave08
08/22/2021, 11:46 AMBig Chungus
08/22/2021, 11:48 AMallprojects {
afterEvaluate {
tasks {
if (findByName("test") == null) {
register("test") {
dependsOn(withType(KotlinTest::class))
group = "verification"
}
}
}
}
}
dave08
08/22/2021, 11:53 AMtasks.named<Test>("test") {
useJUnitPlatform()
testLogging {
showExceptions = true
showStandardStreams = true
exceptionFormat = FULL
}
}
and some tests started running, there's a few compile errors now, but it seems like it's running. Thanks to both of you for pointing out the right direction!sam
08/22/2021, 11:53 AMdave08
10/24/2021, 3:28 PM