-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KotlinTest NoClassDefFoundError #492
Comments
Can you attach your project, or link to it, so I can reproduce this? |
I'll put up a sample project - give me a day or so ... |
I've put up a sample project which seems to confirm my suspicion that it is a runner change that is needed. I also noticed that when the test run fails under these conditions, the build is still reported as successful:
───── kobalt-kotlintest:compile ***** ERROR Error: java.lang.NoClassDefFoundError: io/kotlintest/specs/BehaviorSpec Thread report |
There was a bug in how Kobalt detects whit JUnit runner to use (it mistakenly used JUnit 4). With 1.0.117, JUnit 5 is correctly detected on your project, however, I'm now getting different errors after that. I suspect the way to invoke and build JUnit 5 tests has slightly changed since last time I wrote this code. Do you have a Gradle build that works on your tests, something I could compare with? |
In the meantime, you can run |
That was quick. I can see the warnings and the compile error in Build.kt. I've put up a Gradle equivalent, but limited both the Gradle and Kobalt builds to KotlinTest3 - just makes things easier. Let me know if you need KotlinTest2 I've also added a failing test to both, and used KotlinTest's in-built assertions as a more realistic scenario. Interestingly these caused a compile error, because the test is still using the KotlinTest 2.0.7 library. Knowing this sometimes happens in IDEA, I tried re-importing - but that refused to work because of the compile error. |
Attempting to run tests with KotlinTest causes the error below. I think it is simply because the Kobalt
KotlinTestRunner
is based on JUnit4. KotlinTest uses JUnit5, from version 3.0.0 I believe, which would have been after you added KotlinTest support at #312The text was updated successfully, but these errors were encountered: