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

Iteration name provider does not apply to non parameterized tests in Spock 2 #1236

Closed
ldaley opened this issue Nov 13, 2020 · 2 comments · Fixed by #1238
Closed

Iteration name provider does not apply to non parameterized tests in Spock 2 #1236

ldaley opened this issue Nov 13, 2020 · 2 comments · Fixed by #1238
Assignees
Labels

Comments

@ldaley
Copy link
Member

ldaley commented Nov 13, 2020

Issue description

In Spock 1, the iteration name provider also applied to non parameterized tests. In Spock 2, it does not.

How to reproduce

spock-2-iteration-name-provider-bug.zip

The above is a complete Gradle project that can run a test with Spock 1 or 2.

Works:

$ ./gradlew test -Pspock1

> Task :test

pkg.ExampleSpec > test [suffix] STARTED

pkg.ExampleSpec > parameterized [suffix] STARTED

pkg.ExampleSpec > parameterized [suffix] STARTED

Not works (Spock 2):

$ ./gradlew test

> Task :test

ExampleSpec > test STARTED

ExampleSpec > parameterized [suffix] STARTED

ExampleSpec > parameterized [suffix] STARTED
@leonard84
Copy link
Member

@ldaley could you motivate your usecase of a bit more.
With Spock 2.0 we actually get proper nesting for iterations so those nodes won't be templated.

See also the comment #1238 (review)

@ldaley
Copy link
Member Author

ldaley commented Dec 2, 2020

@leonard84 I commented on that PR.

leonard84 added a commit to leonard84/spock that referenced this issue Dec 25, 2020
to separate name and displayName. The new displayName is now used to
set the reported name.
The name field should now always contain the raw value
although existing extensions might still modify it.

fixes spockframework#1236

Undo
leonard84 added a commit to leonard84/spock that referenced this issue Dec 26, 2020
to separate name and displayName. The new displayName is now used to
set the reported name.
The name field should now always contain the raw value
although existing extensions might still modify it.

fixes spockframework#1236

Undo
leonard84 added a commit that referenced this issue Jan 18, 2021
to separate name and displayName. 

The new displayName is now used to set the reported name.
The name field should now always contain the raw value
although existing extensions might still modify it.

fixes #1236
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.

2 participants