raniejade / spek-idea-plugin

MIT License
48 stars 15 forks source link

NoSuchMethodError when running test with Spek 1.1.3 #49

Closed Jkly closed 7 years ago

Jkly commented 7 years ago

When running a test in IntelliJ IDEA 2017.2.2 with Spek 1.1.3, plugin version 0.4.2, and Junit platform version 1.0.0-RC2, some tests are failing to run in the IDE with:

Exception in thread "main" java.lang.NoSuchMethodError: org.junit.platform.launcher.Launcher.execute(Lorg/junit/platform/launcher/LauncherDiscoveryRequest;)V
    at org.jetbrains.spek.tooling.runner.junit.JUnitPlatformSpekRunner.run(JUnitPlatformSpekRunner.kt:107)
    at org.jetbrains.spek.tooling.MainKt.main(Main.kt:58)

All tests are passing OK when run from ./gradlew test

Snippets from build.gradle:

buildscript {
    ext {
        kotlin_version = '1.1.4-2'
        junitPlatformVersion = "1.0.0-RC2"
    }
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "org.junit.platform:junit-platform-gradle-plugin:$junitPlatformVersion"
    }
}
ext {
    spekVersion = "1.1.3"
}

junitPlatform {
        filters {
            engines {
                include 'spek'
            }
        }
    }

   dependencies {
        testCompile "org.jetbrains.spek:spek-api:$spekVersion"
        testRuntime "org.jetbrains.spek:spek-junit-platform-engine:$spekVersion"
        testRuntime "org.junit.platform:junit-platform-launcher:$junitPlatformVersion"
    }
raniejade commented 7 years ago

Looks like I have to rebundle 1.0.0-RC2 together with the plugin. Will be working on it this week. For now use Spek 1.1.2.

raniejade commented 7 years ago

Got a fix already but I still have to do some more testing.

raniejade commented 7 years ago

@Jkly can you help test this build https://drive.google.com/file/d/0BwvIl05UtnaFamRBOGRtMXQ1Z1k/view?usp=sharing? :)

Jkly commented 7 years ago

@raniejade New build seems to fix it, thanks!

raniejade commented 7 years ago

Awesome, thanks! I'll roll it out once I get the time.

raniejade commented 7 years ago

Just published 0.4.3, should update in a couple of hours.