https://kotlinlang.org logo
Title
j

jlw

10/15/2020, 1:21 PM
I’m in the process of migrating some tests from Spek to Kotest, and I’m running into a problem where gradle won’t execute my kotest specs when I have include the spek test engine. Has anyone ran into this before? Right now it seems I can either execute either spek or kotest but not both.
s

sam

10/15/2020, 2:11 PM
if you have both engines on the classpath, the gradle should run both. What's the error ?
j

jlw

10/15/2020, 2:59 PM
> ./gradlew clean test --tests exampleSpec
No tests found for ….
when I run
gradle test
it executes all of the junit5 tests and spek tests but not any of the kotests
s

sam

10/15/2020, 3:01 PM
and if you remove spek then
gradle test
runs the junit and kotest tests ?
j

jlw

10/15/2020, 3:03 PM
yep
s

sam

10/15/2020, 3:03 PM
so I wonder if spek is interfering with kotest somehow
j

jlw

10/15/2020, 3:04 PM
seems to be that way - was curious if anyone had seen this before
s

sam

10/15/2020, 3:05 PM
I know some people have ran both spek and kotest tests together, when they, like you, are doing a migration.
what does your test config look like in gradle
j

jlw

10/15/2020, 3:07 PM
test {
    useJUnitPlatform() {
        includeEngines 'spek', 'junit-vintage', 'junit-jupiter'
    }
}
s

sam

10/15/2020, 3:08 PM
Try
test {
    useJUnitPlatform() {
        includeEngines 'spek', 'junit-vintage', 'junit-jupiter', 'kotest'
    }
}
j

jlw

10/15/2020, 3:08 PM
didn’t realize kotest was an option - one sec
s

sam

10/15/2020, 3:08 PM
I think if you don't include any, it will run them all
but if you have includeEngines then it will only run those enignes
j

jlw

10/15/2020, 3:09 PM
wow - that solved it
thanks!
s

sam

10/15/2020, 3:09 PM
cool