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

CucumberScenarioLoader parsing Tags incorrectly in 3.2.4 #2799

Closed
arturmalinowski opened this issue Apr 27, 2022 · 3 comments
Closed

CucumberScenarioLoader parsing Tags incorrectly in 3.2.4 #2799

arturmalinowski opened this issue Apr 27, 2022 · 3 comments

Comments

@arturmalinowski
Copy link
Contributor

Hi,

I've noticed that the current implementation for the method tagsFor in CucumberScenarioLoader returns a set of strings that look like this:

  • io.cucumber.messages.types.Tag@3f9f71ff[location=io.cucumber.messages.types.Location@fabb651[line=3,column=1],name=@SomeTag,id=b9753153-a140-4de1-9c93-b9f5ebe268ec]

Further down the line, that set is used to see if it contains an individual tag (@SomeTag) in CucumberSuiteSlicer. TagParser is calling evaluate to achieve that. Unfortunately it only calls contains method on the set, and because it's such a massive String instead of the actual tag name, we always return false.

I did a bit of digging and I can see that the implementation of tagsFor has changed in this commit 9165181b1e01f1e64c0977b57c87732ebdf1520d

I think a solution is to revert back to what it was originally (with a minor change):

FluentIterable.concat(feature.getTags(), scenarioTags(scenarioDefinition)).stream().map(Tag::getName).collect(toSet())

Let me know please!

@arturmalinowski arturmalinowski changed the title CucumberScenarioLoader parsing Tags incorrectly CucumberScenarioLoader parsing Tags incorrectly in 3.2.4 Apr 27, 2022
@wakaleo
Copy link
Member

wakaleo commented Apr 27, 2022

Can you give it a go, and if it works raise a PR?

@arturmalinowski
Copy link
Contributor Author

arturmalinowski commented Apr 27, 2022

Created #2800

I did more testing and it turns out this isnt fully broken - it works fine in features where examples are used.

To see the problem, run the added test without my prod code change.

@wakaleo
Copy link
Member

wakaleo commented Mar 29, 2023

Pretty sure this is fixed.

@wakaleo wakaleo closed this as completed Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants