Can't run Kotlin tests with Junit run configuration (used to work)

Hi,

Have a weird issue where a Junit Run Configuration that was running my Junit tests for months just stopped working and now it can no longer see/find the test.KotlinTestsRunner class (see the enclosed pics for more details). Seems like it’s a Kotlin classpath issue (Java tests run just fine, see below) but the task’s Dependencies tab contains the Kotlin build directories where Kotlin main and test classes are located:

../Kgt-4/build/classes/kotlin/main
../Kgt-4/build/classes/kotlin/test

Eclipse says it "Can not find test class ‘test.KotlinTestsRunner’ in project ‘Kgt-4’ (see the enclosed pic) but the test.KotlinTestsRunner is there:

$ ls -l Kgt-4/build/classes/kotlin/test/test/KotlinTestsRunner.class 
-rw-r--r-- 1 luser luser 762 Jul 21 13:02 Kgt-4/build/classes/kotlin/test/test/KotlinTestsRunner.class

Strangely, Eclipse can find and run my Java tests in test.JavaTestsRunner class with the same Junit configuration (the only difference is the test class name, obviously) without any issues. Here’s how the command line looks like in this case:

/usr/lib/jvm/java-11-openjdk-amd64/bin/java -ea -Dfile.encoding=ANSI_X3.4-1968 -classpath /home/luser/Work/Kgt-4/build/classes/kotlin/main:/home/luser/Work/Kgt-4/build/classes/kotlin/test:/home/luser/Work/Kgt-4/build/classes/java/main:/home/luser/Work/Kgt-4/build/classes/java/test:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.3.41/e24bd38de28a326cce8b1f0d61e809e9a92dad6a/kotlin-stdlib-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.3.41/2ecf4aa059427d7186312fd1736afedf7972e7f7/kotlin-stdlib-common-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains/annotations/13.0/919f0dfe192fb4e063e7dacadee7f8bb9a2672a9/annotations-13.0.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-junit/1.3.41/2ec43deb5225811cb0fd63385b7f9382a78cd225/kotlin-test-junit-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test/1.3.41/98efd6e69ef6f877b086dfd7894a4c36fe5d5736/kotlin-test-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/junit/junit/4.12/2973d150c0dc1fefe998f834810d68f278ea58ec/junit-4.12.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-annotations-common/1.3.41/f57e03dea3d1a81b5e1b3cdcf4eb2710a3fac173/kotlin-test-annotations-common-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-test-common/1.3.41/744000c1a0ef654706ce3367a10543590dab9246/kotlin-test-common-1.3.41.jar:/home/luser/.gradle/caches/modules-2/files-2.1/org.hamcrest/hamcrest-core/1.3/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar:/home/luser/.eclipse/org.eclipse.platform_4.12.0_297942815_linux_gtk_x86_64/configuration/org.eclipse.osgi/403/0/.cp:/home/luser/.eclipse/org.eclipse.platform_4.12.0_297942815_linux_gtk_x86_64/configuration/org.eclipse.osgi/402/0/.cp org.eclipse.jdt.internal.junit.runner.RemoteTestRunner -version 3 -port 39669 -testLoaderClass org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader -loaderpluginname org.eclipse.jdt.junit4.runtime -classNames test.JavaTestsRunner

$ ls -l Kgt-4/build/classes/java/test/test/JavaTestsRunner.class 
-rw-r--r-- 1 luser luser 666 Jul 21 13:02 Kgt-4/build/classes/java/test/test/JavaTestsRunner.class

The issue appeared first on 2019-3R, I then moved to 2019-6R but the issue is still there.

Any ideas? Thanks

hi @lidisi,
Are you still experiencing these issues?

Yes, I’m on Eclipse 2019-09 R (4.13.0) now but the problem is still there.

See 549471 – Junit run configuration fails to see/find a Kotlint test class for more info, if interested.

Okay, let’s see if we can get this issue fixed for you. :slight_smile:

Any progress? Still seeing this issue in Eclipse 2019-12R. Thanks