Can't run individual Spock tests in IntelliJ IDEA 2021.2 ("No runnable methods")

I just upgraded to IDEA 2021.2 from 2021.1 and lost the ability to run individual Spock tests from the IDE. I can run all tests in the source folder, but when attempting to run an individual test using the gutter icon in the source editor or from the right-click menu in the project window I get errors like this:

org.junit.runners.model.InvalidTestClassError: Invalid test class 'HelloSpockSpec':
1. No runnable methods

at org.junit.runners.ParentRunner.validate(
at org.junit.runners.ParentRunner.<init>(
at org.junit.runners.BlockJUnit4ClassRunner.<init>(
at org.junit.runners.JUnit4.<init>(
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(
at org.junit.internal.requests.ClassRequest.createRunner(
at org.junit.internal.requests.MemoizingRequest.getRunner(
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(
at com.intellij.rt.junit.JUnitStarter.main(

This is with Spockframework 2.0-groovy-3.0, which has Junit 5 runner under the hood.

Official example project where this happens (and didn't use to with the previous version):

Will try to downgrade to the previous IDEA version.


I have the same exact thing happening right after upgrade to 2021.2. Can't run any test. Very frustrating.


Please sign in to leave a comment.