07/11/2020, 7:38 PM
I'm having trouble using Kotest with a multi-platform project. Using the new 1.4-M3 project wizard, I started a new MpTest project with IOS and Android as targets. The wizard generates a number of modules, the one I'm focusing on for this issue is the "shared" module. "Shared" gets 6 source directories built by the M3 wizard; androidMain, androidTest, commonMain, commonTest, iosMain, and iosTest. For this issue I'm using commonMain for a couple of multi-platform classes, and androidTest for Kotest 4.1.1 unit tests of the commonMain classes. The trouble occurs when using the plugin to attempt to debug the unit test class (in this case "BasicsTest"):
Exception in thread "main" java.lang.ClassNotFoundException: BasicsTest
Looking at the invoked gradle build I can see no evidence that it attempted to build the unit test class BasicsTest, so it's not on the classpath. If I then try to edit the Run Configuration for the debug attempt, it shows the plugin selected the "shared" classpath by default. Dropping down the list of classpaths available does not show shared.androidTest as a choice. So I have no way to invoke a debug of a unit test on a multi platform project's shared module. Is this a Kotest plugin issue? Or a multiplatform M3 issue? Until I resolve this I don't see a way to debug/run Kotest unit tests that are using common classes in the IDE. Thanks in advance for any info/help. FWIW I have already posted a precursor question of this problem as a recent thread in #eap, in that thread we concluded it better to post here:
Whatever this is, it isn't just Kotest. In the same project setup, I wrote a basic test class in commonTest using kotlin.test package stuff available for multi-platform, and it gets the same error. It acts similar in Idea as this old thread: StackOverflow old issue So I'm gonna start digging into what's going on with gradle in this config. Since now this issue only involves 1.4-M3 and multi platform, would this post be better off in the #multiplatform channel until I can find the root cause? Or is it still helpful to Kotest?


07/14/2020, 4:39 AM
Yes I think it would be useful to keep us aprised