https://kotlinlang.org logo
#spek
Title
# spek
l

Leonell

10/10/2018, 11:59 AM
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

raniejade

10/10/2018, 10:28 PM
can you give more info about the project? Is it android, what IDE are using, plugin version, etc...
l

Leonell

10/11/2018, 12:34 AM
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

raniejade

10/11/2018, 12:35 AM
There's an rc version for the plugin, you need to remove the dev channel from your plugin repository list.
l

Leonell

10/11/2018, 12:41 AM
I upgraded both to the rc version 😅
r

raniejade

10/11/2018, 12:42 AM
ohh, misread sorry 😂
can you paste your build file?
l

Leonell

10/11/2018, 12:42 AM
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

raniejade

10/11/2018, 1:12 AM
Can you try adding the excludes mentioned here https://spekframework.org/setup-jvm/?
l

Leonell

10/11/2018, 1:16 AM
Still the same issue
r

raniejade

10/11/2018, 2:04 AM
weird, does it work when running tests from gradle?
l

Leonell

10/11/2018, 2:20 AM
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

raniejade

10/11/2018, 2:22 AM
can you revert back to kotlin 1.2? then don't exclude junit5 dependencies from the runner.
l

Leonell

10/11/2018, 2:27 AM
I'm still seeing "Nothing here" when I click the green arrow but the test task does work now.
r

raniejade

10/11/2018, 2:28 AM
Hmmm. Did you re-import your project?
l

Leonell

10/11/2018, 2:33 AM
Yea
r

raniejade

10/11/2018, 2:34 AM
Are you able to share the project?
l

Leonell

10/11/2018, 2:43 AM
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

raniejade

10/11/2018, 4:39 AM
Interesting, hmmm. Probably has something to do with changes with kotlin 1.3?
217 Views