-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
Cucumber-JVM has rather inconsistent support for uri's in the feature path.
For example: cucumber classpath:com/example/my/app.feature and cucumber src/main/java/com/example/my/app.feature work but cucumber file:src/test/resources/com/example/my/app.feature does not. Nor does cucumber hdfs:path/to/cloud/location/app.feature or any other protocol that could be supported by the jvm.
At the same time we do support custom ResourceIteratorFactory implementations but only for resources on the classpath So cucumber classpath:features.jar#!com/example/app.feature works but cucumber jar:src/test/resources/features.jar#!/com/example/app.feature does not.
In essence we are mimicking functionality provided by FileSystem and Path and are doing so poorly. Looking back in time this made sense as Cucumber was originally written for Java 6 when we didn't have nice things yet.
Never the less it makes it rather hard to explain what exactly the feature path is and what people can do with it. This can be resolved by:
- Ensuring that after parsing the feature path consists of proper URI's [Core] Formalize glue and feature paths #1544.
- Using
Paths.get(URI uri),Files.walkFileTreeand related utilities to scan and discover features. An example of this can be found in junit-jupiter/PathScanner. [Core] Replace ResourceIterable with standard Java solutions #1820