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

Regression with JUnit Platform it is not possible to select inherited tests via command line #15185

Closed
leonard84 opened this issue Nov 16, 2020 · 1 comment · Fixed by #15943
Assignees
Labels
Milestone

Comments

@leonard84
Copy link
Member

This issue is came up in spockframework/spock#1235, according to @marcphilipp in junit-team/junit5#2476 the issue is in gradle itself.


Expected Behavior

With the old JUnit, i.e. non useJUnitPlatform(), it is possible to run:

./gradlew test --tests *ChildSpec.parent -Pspock1

to execute an inherited test.

(See spockframework/spock#1235 for a demo project)

Current Behavior

With the JUnitPlatform and Spock 2 the same command does not execute a test.

./gradlew test --tests *ChildSpec.parent

Context

My guess is that it is probably that line here
return matcher.matchesTest(methodSource.getClassName(), methodSource.getMethodName());

return matcher.matchesTest(methodSource.getClassName(), methodSource.getMethodName());

Comment by @marcphilipp

The MethodSource is supposed to contain the declaring class, hence "source", and was introduced to allow IDE navigation. The filtering code could check for the parent descriptor's ClassSource in this case instead of using the MethodSource's class name.

The filtering code that probably needs to be changed is in Gradle, not JUnit Platform. Would you mind opening a Gradle issue instead?

Steps to Reproduce

See spockframework/spock#1235 for a demo project

@marcphilipp
Copy link
Contributor

Please bear in mind that my analysis (if you can even call it that) above is preliminary. Should be easy to reproduce in a functional test, though.

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

Successfully merging a pull request may close this issue.

5 participants