I'm not sure why this happened out of seemingly no...
# spek
l
I'm not sure why this happened out of seemingly nowhere, but whenever I click the green arrow to run a test, all I see is "Nothing here". I also keep getting this error.
r
can you give more info about the project? Is it android, what IDE are using, plugin version, etc...
l
It's a regular JVM project. I'm using IntelliJ IDEA 2018.2. I was first using the 2.0.0-alpha.2 versiom of the plugin and dependencies but later upgraded to 2.0.0-rc.1 but that didn't do anything.
r
There's an rc version for the plugin, you need to remove the dev channel from your plugin repository list.
l
I upgraded both to the rc version 😅
r
ohh, misread sorry 😂
can you paste your build file?
l
The same issue also pops up when I create new projects. Running the test task works though.
Copy code
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
    kotlin("jvm") version "1.3.0-rc-146"
}

group = "leo"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    jcenter()

    maven {
        setUrl("<http://dl.bintray.com/kotlin/kotlin-eap>")
    }

    maven {
        setUrl("<https://dl.bintray.com/spekframework/spek-dev>")
    }
}

dependencies {
    compile(kotlin("stdlib-jdk8"))

    testImplementation("org.amshove.kluent", "kluent", "1.42")

    testImplementation("org.spekframework.spek2", "spek-dsl-jvm", "2.0.0-rc.1")
    testRuntimeOnly("org.spekframework.spek2", "spek-runner-junit5", "2.0.0-rc.1")

    testImplementation(kotlin("reflect"))
}

tasks {
    withType<KotlinCompile> {
        kotlinOptions.jvmTarget = "1.8"
    }

    withType<Wrapper> {
        gradleVersion = "4.10.2"
    }

    withType<Test> {
        useJUnitPlatform {
            includeEngines("spek2")
        }
    }
}
Here's one of the test ones.
I have another test project with gradle groovy because I recently migrated my project to gradle kotlin and thought it was a misconfiguration. However even that project I'm facing the same issue.
r
Can you try adding the excludes mentioned here https://spekframework.org/setup-jvm/?
l
Still the same issue
r
weird, does it work when running tests from gradle?
l
It worked when I tested it yesterday but it doesn't just now.
Copy code
org.gradle.api.internal.tasks.testing.TestSuiteExecutionException: Could not complete execution for Gradle Test Executor 5.
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:63)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy1.stop(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:123)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:748)
Copy code
Caused by: java.lang.NoClassDefFoundError: org/junit/platform/engine/TestEngine
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
	at org.junit.platform.launcher.core.DefaultLauncher.validateUniqueIds(DefaultLauncher.java:63)
	at org.junit.platform.launcher.core.DefaultLauncher.<init>(DefaultLauncher.java:58)
	at org.junit.platform.launcher.core.LauncherFactory.create(LauncherFactory.java:59)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:90)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$100(JUnitPlatformTestClassProcessor.java:77)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:73)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
	... 25 more
Getting this in the test report
r
can you revert back to kotlin 1.2? then don't exclude junit5 dependencies from the runner.
l
I'm still seeing "Nothing here" when I click the green arrow but the test task does work now.
r
Hmmm. Did you re-import your project?
l
Yea
r
Are you able to share the project?
l
This is the project I've been using to test. The actual project I first encountered the problem is a private project.
Interesting. I reinstalled IntelliJ IDEA without importing my previous settings and it worked. The green arrow now shows the run test option. However, when I switched from the stable channel to the 1.3 EAP channel, it shows "Nothing here" again. 🤔
r
Interesting, hmmm. Probably has something to do with changes with kotlin 1.3?
274 Views