Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MissingMethodException after update Spock itself to junit-bom:5.6.0-RC1 #1073

Open
szpak opened this issue Jan 13, 2020 · 2 comments
Open

MissingMethodException after update Spock itself to junit-bom:5.6.0-RC1 #1073

szpak opened this issue Jan 13, 2020 · 2 comments

Comments

@szpak
Copy link
Member

@szpak szpak commented Jan 13, 2020

Issue description

Several own Spock- tests started to fail after upgrade junit-bom from 5.5.2 to 5.6.0-RC1 (master) with:

groovy.lang.MissingMethodException: No signature of method: static spock.util.EmbeddedSpecRunner.tests() is applicable for argument types: () values: []

It would be good to make Spock junit-5.6 (Platform 1.6.0) compatible.

E.g.

method name can still contain parentheses

Condition failed with Exception:

result.tests().started().list().testDescriptor.displayName == ["an actor (named fred) age 30"]
|      |
|      groovy.lang.MissingMethodException: No signature of method: static spock.util.EmbeddedSpecRunner.tests() is applicable for argument types: () values: []
|      Possible solutions: use([Ljava.lang.Object;), getAt(java.lang.String), use(java.util.List, groovy.lang.Closure), use(java.lang.Class, groovy.lang.Closure), wait(), wait(long)
|      	at org.spockframework.smoke.parameterization.UnrolledFeatureMethods.method name can still contain parentheses(UnrolledFeatureMethods.groovy:320)
<spock.util.EmbeddedSpecRunner$SummarizedEngineExecutionResults@314708ce results=org.junit.platform.testkit.engine.EngineExecutionResults@50706160>

	at org.spockframework.smoke.parameterization.UnrolledFeatureMethods.method name can still contain parentheses(UnrolledFeatureMethods.groovy:320)
Caused by: groovy.lang.MissingMethodException: No signature of method: static spock.util.EmbeddedSpecRunner.tests() is applicable for argument types: () values: []
Possible solutions: use([Ljava.lang.Object;), getAt(java.lang.String), use(java.util.List, groovy.lang.Closure), use(java.lang.Class, groovy.lang.Closure), wait(), wait(long)
	... 1 more

All the tests seem to be related to parameterization.

How to reproduce

Bump junit-bom to "org.junit:junit-bom:5.6.0-RC1" and call gw check.

Additional Environment information

OpenJDK 11.0.5, Linux, spock from master

Additional information

Failed tests

    FeatureMethods. are nevertheless reported with their original name
    FeatureMethods. can have names containing any characters in embedded specs
    PendingFeatureExtensionSpec. @PendingFeature includes reason in exception message
    RequiresExtension. verifyExecution
    DataTables. cell references are evaluated correctly in the method's name
    UnrolledFeatureMethods. can unroll a whole class at once
    UnrolledFeatureMethods. expressions in naming pattern that can't be evaluated are prefixed with 'Error:'
    UnrolledFeatureMethods. if creation of a data provider fails, feature isn't unrolled
    UnrolledFeatureMethods. iterations of an unrolled feature foo are named foo[0], foo[1], etc.
    UnrolledFeatureMethods. method name can act as naming pattern
    UnrolledFeatureMethods. method name can still contain parentheses
    UnrolledFeatureMethods. method-level unroll annotation wins over class-level annotation
    UnrolledFeatureMethods. naming pattern in @Unroll annotation wins over naming pattern in method name
    UnrolledFeatureMethods. naming pattern may refer to data variables
    UnrolledFeatureMethods. naming pattern may refer to feature name and iteration count
    UnrolledFeatureMethods. naming pattern supports property expressions
    UnrolledFeatureMethods. naming pattern supports zero-arg method calls
    UnrolledFeatureMethods. variables in naming pattern whose value is null are replaced correctly
@leonard84

This comment has been minimized.

Copy link
Member

@leonard84 leonard84 commented Jan 13, 2020

This is caused by the deprecation of said method in EngineExecutionResults and the behavior of @Delegate, by default it does not delegate deprecated methods. The quick fix would be to set @Delegate(deprecated=true) in spock.util.EmbeddedSpecRunner.SummarizedEngineExecutionResults. The correct fix is to replace all usages of tests() by testEvents() and so on, see the deprecation notes for more information.

leonard84 added a commit that referenced this issue Feb 10, 2020
@leonard84

This comment has been minimized.

Copy link
Member

@leonard84 leonard84 commented Feb 10, 2020

Spock-2.0-M2 was just released with the quickfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.