Anyone got any tips for debugging kotest + depende...
# kotest
s
Anyone got any tips for debugging kotest + dependency issues? I've got an existing project using kotest 4.0.3, but when I add the following line to my build.gradle, non of my tests are getting run (with ./gradlew clean test): • implementation 'com.github.thake.avro4kavro4k kafka serializer0.2.0' I'm assuming its pulling in a dep that breaks kotest in some way, but can't figure out what, any advice would be really useful!
I can actually see some of the tests starting to run, but they never get allowed to complete and its just outputs: Test result: SUCCESS Test summary: 0 tests, 0 succeeded, 0 failed, 0 skipped
s
So simply pulling in that dependency breaks kotest ?
s
yup. 🙂
Didn't add any extra code, just the line in the build.gradle file
s
that's bizzare
avro4k is one of my libraries as well
I've checked both avro4k and the kafka wrapper by thake, and neither of them are doing anything weird with kotlintest deps
s
Oh, yeah - trying to use that with kafka streams and that lib seemed to have a serde serializer i could use
s
I would do a gradle dependency tree, and grep it for both io.kotest and io.kotlintest dependencies and tell me what appears
You can also run with an env var, KOTEST_DEBUG=true, and that will spam your logs with details on what kotest is doing. That might be useful
s
Ok, have ran with that debug and here is the before / after. Not sure if that tells you something? https://www.diffchecker.com/VeFifuz4
s
This is really odd
Can you try commenting out IntegrationTest and rerunning
It's not finding any tests in there, and I wonder if some init exception is breaking.
s
OK, so commenting out that test allowed the other to pass - also there seems to be version mis-match with some of my deps, so i'll explore that too: https://www.diffchecker.com/WY6JgTzg
s
So it seems that something in your integration tests breaks when adding in avro4k
BUT kotest shouldn't just ignore all your tests
If you can find out what exception is being thrown where, and file a bug report (or ping me) that would be amazing. It might be related to this https://github.com/kotest/kotest/issues/1381
m
@sam Gradle also has built-in tools to help with Dependencies. Take a look at Dependency Insight. https://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html#example_using_the_dependency_insight_report_for_a_given_dependency
./gradlew dI --dependency kotest --configuration testRuntimeClasspath
dI is short for dependencyInsight as Gradle supports smart aliasing. dependency seems to be a wildcard search And configuration would be the one you're interested in. By default, it looks at the
main
sourceset, so the above looks at the
test
sourceset.
👍🏻 1
s
Good to know mike, seems pretty handy
The bug is definitely in kotest though, as it's swallowing an exception I think
m
It's definitely better than producing dependency reports before and after, and doing a file comparison. Very helpful tracking down dependency issues when you have them. Good luck on your bug quest.
s
Thank you 🙂
s
Ah damn, yup found the exception!
I had actually seen it before but thought it was unrelated to this kotest issue!
a kafka dependency issue...
Caused by: java.lang.NoClassDefFoundError: org/apache/kafka/clients/admin/Admin
(java.lang.reflect.InvocationTargetExceptio)
s
And where in the integration test is that being thrown - constructor, a beforeTest block, or .....
s
beforeSpec block
of a FunSpec
s
So it's basically the same thing as 1381
I'll get a fix out for this next day or two, will be in 4.0.4 and 4.1.0 snapshot
s
Thanks for the help!!!
And my build is green - using avro4k + kotest + avro4k-kafka-serializer! Thanks very much for your debugging advice!
s
You are welcome. Don't forget to star all 3 repos ;)
s
Thats a fair nudge - have done! So much more enjoyable to use data classes with kafka that the mutable java classes that the gradle-avro-plugin generates!
👍🏻 1