Cannot run single test when using with Kotest 4.2.0.RC2
See original GitHub issueWhen I run a single test (“first test” in my code example) withing a test class using the green Run test in the gutter, the test fails with “java.lang.NoClassDefFoundError: io/kotest/core/filters/TestCaseFilter” exception. Running all tests withing test class (using the double Run button in the gutter at the class declaration line) works fine.
Code example:
import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe
class TestMyClass : StringSpec({
"first test" {
2 * 2 shouldBe 4
}
})
Stack trace:
Exception in thread "main" java.lang.NoClassDefFoundError: io/kotest/core/filters/TestCaseFilter
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:821)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:719)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:642)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:600)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at io.kotest.launcher.ExecuteTestsKt.executeTests(executeTests.kt:37)
at io.kotest.launcher.Execute.run(launcher.kt:71)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:168)
at com.github.ajalt.clikt.parsers.Parser.parse(Parser.kt:16)
at com.github.ajalt.clikt.core.CliktCommand.parse(CliktCommand.kt:258)
at com.github.ajalt.clikt.core.CliktCommand.parse$default(CliktCommand.kt:255)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:273)
at com.github.ajalt.clikt.core.CliktCommand.main(CliktCommand.kt:298)
at io.kotest.launcher.LauncherKt.main(launcher.kt:14)
Caused by: java.lang.ClassNotFoundException: io.kotest.core.filters.TestCaseFilter
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 18 more
Environment:
- Plugin version: 1.1.9-IC-2020.1
- IntelliJ IDEA 2020.2 Ultimate Edition
- Kotest 4.2.0.RC2
- OpenJDK 14.0.2
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Pulling Kotest 4.2.0-RC2 from Central complains ... - GitHub
I confirm the issue is gone. Contextually, I want to amend my previous post, in fact there is a way in Gradle to...
Read more >Hi we ve noticed that when we run a single junit test or sin | Kotest ...
(Kotest version 4.1.3 and 4.2.0.RC2). https://linen-assets.s3.amazonaws.com/attachments/. if I run the kotest file, this doesn't trigger the junit tests.
Read more >Cannot run single test when using with Kotest 4.2.0.RC2 - Codesti
When I run a single test ("first test" in my code example) withing a test class using the green Run test in the...
Read more >Best-of-breed OpenTracing utilities, instrumentations and ...
My Intention is to have multiple Traces of the same name running at the same time. Basically I get a call through HTTP...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Today I got the plugin update (not it’s v. 1.1.11-IC-2020.1), switched to the final version 4.2.0 Things got even worse - now I can’t run even all tests in the class using the gutter button - I get this error message:
After reverting the Kotest version back to 4.2.0.RC2 with the latest plugin, it works as before - running all tests cases withing a class works, running a single test does not.
I created a repo with a minimal project to demonstrate this behavior - https://github.com/Ultranium/kotest-idea-plugin-bug It contains only a single test class in the file src/test/kotlin/TestMyClass.kt.
I am having similar variation of problem.
It used to work fine, until I have upgrade clikt to 3.x from 2.x. As kotest-framework depends on clikt@2.x, IntelliJ plugin was not able to find matching bytecode symbol from 3.x jar.