RuntimeOptions.cucumberfeatures method is broken in latest master
See original GitHub issueSummary
Following method, cucumberFeatures in RuntimeOptions class is not returning filtered cucumber features
Expected Behavior
Based on arguments passed from cli, cucumberFeatures method should return filtered features. This is working fine on cucumber-jvm 1.2.5
Current Behavior
cucumberFeatures is not returning filtered features based on args passed
Possible Solution
Steps to Reproduce (for bugs)
Precondition:
Multiple cucumber feature files are present under resources folder and each scenarios have unique tags associated to it.
For example,
args -> [--plugin, pretty, --plugin, html:uiwebtest/output/cucumber/html, --plugin, json:uiwebtest/output/cucumber/json/cucumber.json, -t, not @pending and not @wip and not @defect and not @manual and @settings_test_1, --glue, com.cuke.webrtc.tests, uiwebtest/src/main/resources]
Steps:
RuntimeOptions opt = new RuntimeOptions(args);
List<CucumberFeature> cucumberFeatures = opt.cucumberFeatures(new MultiLoader(Thread.currentThread().getContextClassLoader()),new EventBus(TimeService.SYSTEM));
**Current Behaviour**: cucumberFeatures contains all features and not filtered based on args passed
For above args, It should return only 1 feature(which has a scenario associated to tag @settings_test_1)
Note:
It is working fine with cucumber-jvm 1.2.5
Context & Motivation
Motivation:
Run cucumber scenarios parallelly (each scenario are independent)
How do we do it:
Each scenario will have a unique tag associated with it. From build.gradle, we get all filtered scenario tags and run each tag on separate JVM process. During this, we consume RuntimeOptions class as we don’t want to re-write logic to get filtered scenarios
Your Environment
- Version used: cucumber-jvm 2.0.1
- Operating System and version: Macos Sierra
- Link to your project:
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Mmh. Adding a unique scenario tag to each scenario is a bad practice. It adds error prone manual labor. It would be better if you were to address the pickles the their uri. If you have a look at the current code in Runtime it shouldn’t be too difficult to figure out how to compile pickles and filter those that will be executed and extract their uris. Though I also can not endorse any hacking onto cucumber runtime. We might change it again and again in the future.
As such I would recommend that you create a custom
Formatter
that listens toTestCaseStarted
events. When used in combination with--dry-run
you can use it to create a list of uris of pickles that will be executed. This you can then pass onto your parallel runner.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.