-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[Core] Formalize glue and feature paths #1544
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4b35d68
to
95541c6
Compare
407ad15
to
8e02410
Compare
The feature path was poorly defined. It could either be a path or a path with a `classpath:` prefix. This ambiguity allowed room for various inconsistencies and misinterpretations. 1. Pickle URI's were not actually uniform. Depending on operating system different path seperators would be used. 2. Pickle URI's did not identify a resource. The `classpath:` prefix would be dropped after loading a feature file. This lead to a fairly complex try-catch-try-again-on-the-classpath mechanism when loading rerun file. By properly defining the feature identifier it becomes possible to parse it in `RuntimeOptions` and propagate a consistent URI to other parts of cucumber-jvm. This reduces the need for work arounds in various places. Features are identified by a URI. This URI can either be absolute: `scheme:/absolute/path/to.feature`, or relative to the current working directory:`scheme:relative/path/to.feature`. In either form, when the scheme is omitted `file` will be assumed: `path/to.feature`. On systems that use a `File.separatorChar` other then `/` `File.separatorChar` can be used as a path separator. When doing so when the scheme must be omitted: `path\to.feature`. It is recommended to use `/` as the path separator.
8e02410
to
032f8f2
Compare
The glue path is a class path URI to a package. The glue path can be written as either a package name: `com.example.app` a path `com/example/app` or uri `classpath:com/example/app`. On file system with a path separator other then `/` `com\example\app` is also a valid glue path. It is recommended to always use the package name form.
84c147b
to
fafe09f
Compare
This was referenced Mar 15, 2019
Closed
3 tasks
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Feature Path
The feature path was poorly defined. It could either be a path or
a path with a
classpath:
prefix. This ambiguity allowed roomfor various inconsistencies and misinterpretations.
Pickle URI's were not actually uniform. Depending on operating
system different path seperators would be used.
Pickle URI's did not identify a resource. The
classpath:
prefix would be dropped after loading a feature file. This
lead to a fairly complex try-catch-try-again-on-the-classpath
mechanism when loading rerun file.
By properly defining the feature identifier it becomes possible to
parse it in
RuntimeOptions
and propagate a consistent URI toother parts of cucumber-jvm. This reduces the need for work
arounds in various places.
Features are identified by a URI. This URI can either be absolute:
scheme:/absolute/path/to.feature
, or relative to thecurrent working directory:
scheme:relative/path/to.feature
.In either form, when the scheme is omitted
file
will beassumed:
path/to.feature
.On systems that use a
File.separatorChar
other then/
File.separatorChar
can be used as a path separator. Whendoing so when the scheme must be omitted:
path\to.feature
.It is recommended to use
/
as the path separator.Fixes: #1547
Glue Path
Likewise the feature path was poorly defined. It could be a resource
name, a classpath URI or a file path. This ambiguity allowed room
for various inconsistencies and misinterpretations.
The glue path can now be written as either a package name:
com.example.app
a path
com/example/app
or uriclasspath:com/example/app
.On file system with a path separator other then
/
com\example\app
is also a valid glue path.
It is recommended to always use the package name form.
Types of changes
Checklist: