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

[Core] Fix filtering scenarios loaded from jar #1618

Merged
merged 1 commit into from May 3, 2019
Merged

[Core] Fix filtering scenarios loaded from jar #1618

merged 1 commit into from May 3, 2019

Conversation

derwasp
Copy link
Member

@derwasp derwasp commented May 1, 2019

Summary

Don't add an extra slash after the classpath: scheme

Details

Changed the ZipResource to preserve the original path of the zipped entity.

Motivation and Context

I am running cucumber tests with features loaded from classpath:, like this:

java -cp fatjar.jar cucumber.api.cli.Main "classpath:features/FeatureWithExamples.feature:64"

However, when cucumber parses this path and creates a ZipResource from it, it adds an extra slash:
image

And the url becomes classpath:/features/FeatureWithExamples.feature:64

image

This becomes a problem down the line, when LinePredicate tries to filter out the pickles:
image

This if does't pass (because the key is not the one in the map) and instead of filtering the pickles out, it just lets all of the though the filter.

I tried changing the path to be classpath:/features/FeatureWithExamples.feature:64 right away. But then the loader is unable to get the resource:

image

Can you please tell me whether this change makes sense or am I confusing things here?

Types of changes

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

@derwasp derwasp marked this pull request as ready for review May 1, 2019 13:02
@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.116% when pulling 6b46ef3 on derwasp:feature/support-classpath-for-features into 437bb3a on cucumber:master.

@derwasp
Copy link
Member Author

derwasp commented May 1, 2019

Seems like it's related to #1544 by @mpkorstanje

@mpkorstanje mpkorstanje changed the title Don't add an extra slash after the classpath scheme [Core] Fix filtering scenarios loaded from jar May 3, 2019
@mpkorstanje mpkorstanje merged commit 25f467f into cucumber:master May 3, 2019
@aslakhellesoy
Copy link
Contributor

Hi @derwasp,

Thanks for your making your first contribution to Cucumber, and welcome to the Cucumber committers team! You can now push directly to this repo and all other repos under the cucumber organization! 🍾

In return for this generous offer we hope you will:

  • ✅ Continue to use branches and pull requests. When someone on the core team approves a pull request (yours or someone else's), you're welcome to merge it yourself.
  • 💚 Commit to setting a good example by following and upholding our code of conduct in your interactions with other collaborators and users.
  • 💬 Join the community Slack channel to meet the rest of the team and make yourself at home.
  • ℹ️ Don't feel obliged to help, just do what you can if you have the time and the energy.
  • 🙋 Ask if you need anything. We're looking for feedback about how to make the project more welcoming, so please tell us!

On behalf of the Cucumber core team,
Aslak Hellesøy
Creator of Cucumber

@mpkorstanje
Copy link
Contributor

Cheers!

@derwasp derwasp deleted the feature/support-classpath-for-features branch May 3, 2019 08:47
@mpkorstanje
Copy link
Contributor

mpkorstanje commented May 5, 2019

@derwasp should be a new version available in a few hours.

@derwasp
Copy link
Member Author

derwasp commented May 7, 2019

@mpkorstanje thank you for the rocket-fast release!

derwasp added a commit to albumprinter/junit-synnefo that referenced this pull request May 7, 2019
@mpkorstanje
Copy link
Contributor

No problem. Would you mind commenting on:

cucumber/common#568

derwasp added a commit to albumprinter/junit-synnefo that referenced this pull request May 8, 2019
@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

1 similar comment
@lock
Copy link

lock bot commented May 20, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants