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

spockito.Unroll does not adhere to the Gradle "--tests <pattern>" argument #10

Closed
roded opened this issue Apr 7, 2022 · 5 comments
Closed
Assignees
Labels

Comments

@roded
Copy link

roded commented Apr 7, 2022

Seems like when running a Gradle test task with explicit tests inclusion via the --tests argument, spockito runs the unrolled tests even if their names do not adhere to the inclusion argument.

I.e.,
:my-project:test --tests "*NoSuchTest*"
will run all unrolled spockito tests.

@terzerm terzerm self-assigned this Apr 7, 2022
@terzerm
Copy link
Member

terzerm commented Apr 7, 2022

Hi -- thanks for reporting this.
Can you please provide some more information? E.g. which version of spockito are you referring to, and what junit version?

I tried to reproduce the problem directly inside the spockito project itself:

./gradlew :spockito-junit4:test --tests *NoSuchTest*

> Configure project :
spockito version=2.1-SNAPSHOT release=false

> Task :spockito-junit4:test FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spockito-junit4:test'.
> No tests found for given includes: [*NoSuchTest*](--tests filter)

similar for the junit5 module or when using the whole project

@roded
Copy link
Author

roded commented Apr 7, 2022

Sure. I'm using the latest spockito with JUnit4. i.e., spockito-junit4:2.0 and Gradle 7.4.2.
I can try to create a test project if required.
Thanks for looking into this.

@roded
Copy link
Author

roded commented Apr 11, 2022

@terzerm Hope this helps: https://github.com/roded/spockito-issue-10

@terzerm
Copy link
Member

terzerm commented May 5, 2022

Hi again,
Sorry for the late reply.
If I comment out the "getByName" task in your build.gradle file it works as expected for me.
If anything then this seems to be more gradle. than spockito related, hence closing the issue.
Hope this helps.

@roded
Copy link
Author

roded commented May 6, 2022

Interesting. Thanks for looking into it.

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

No branches or pull requests

2 participants