Hey guys :wave: Does anyone know if it’s possible ...
# kotest
k
Hey guys 👋 Does anyone know if it’s possible to have kotest and junit5 tests coexist? I have a project with kotest setup and I wanted to give junit5 a go in Kotlin, but when I added
Copy code
testImplementation(platform("org.junit:junit-bom:5.7.0"))
    testImplementation("org.junit.jupiter:junit-jupiter")
tests are not picked up by Gradle. Do Jupiter and Kotest not like one another?
s
you should be able to use both together
as long as jupiter is on the classpath, you might have to do the include engine configuration that gradle provides
k
thanks so much for confirming this @sam I’ve had a close look at my tests and I missed the fact that
suspend
tests are not run by junit and I have to wrap them in
runBlocking
(which is not ideal…). Thanks anyway! 🙂
s
Ah ok. Let me know how you think junit compares to kotest for kotlin tests.
k
sure, will do! 🙂 Overall I think kotest is a great testing framework, thanks a lot for all the effort writing and maintaining it @sam My biggest complaint and the reason why I want to take a look at JUnit is the incredibly slow performance while editing although I do realise that this is probably an issue on the IntelliJ side. I’m in the process of filing a bug and still need to profile CPU usage, but editing a large test suite (over 200 lines of code) is an incredibly annoying experience on a 2020 MacBook Pro 2,3 GHz i7…
s
It's intellij and generics
It's also miles faster on 1.4.20
And you can use annotation spec which is junit by another name
k
Oh, I’ve not thought about annotation spec, good call, thanks! Will definitely take a look! And will also check out 1.4.20, I’m still on 1.4.10
s
I was surprised at how much faster it is - you don't need to upgrade your project, it's the 1.4.20 intellij plugin that is faster.
k
strange.. I can’t see this update yet in 2019.3 🤔 maybe I need to switch to 2020.3…
I’ve just remembered what I miss in kotest (again: probably IntelliJ’s thing): not being able to run test suites from IDE:
( ▶️ icon disappears as soon as I extend AnnotationSpec)
s
do you have the kotest plugin ?
k
🤦‍♂️ no, I don’t. Oh man, you’ve literally made me a happy Kotlin developer again 😄 I just need to take 1.4.20 for a ride 🙂
😂 1
wow, you’re right @sam 1.4.20 is unimaginably faster. Who would have thought? 😉 Thanks again for all the insights, I’ll happily stick to Kotest 🎉 😄
s
I was super impressed when I tried the 1.4.20 rc, because I was like, what, how is this so much faster
👍 1
It was never a kotest thing, it was a problem with too many lambdas / type parameters. So things like arrow would grind to a halt as well.
k
I’ve only noticed massive slow down with Kotest, as I’ve not used arrow equally heavily 😅