question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RuntimeOptions.cucumberfeatures method is broken in latest master

See original GitHub issue

Summary

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:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mpkorstanjecommented, Sep 27, 2017

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 to TestCaseStarted 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.

0reactions
lock[bot]commented, Oct 24, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error while running cucumber in junit - java - Stack Overflow
i am trying to run a simple cucumber feature test. below are my feature file, step definition file and junit runner file. but...
Read more >
IntelliJ Cucumber support fails after update from ... - YouTrack
I can run all tests via RunCukes (junit) or gradle:test but not specific Scenarios or Features. I tried installing the latest versions (released...
Read more >
Getting runtime cucumberexception for error parsing feature file
When I execute feature file where I have written my scenarios, ... cucumberFeatures(RuntimeOptions.java:201) at cucumber.runtime.
Read more >
Getting @BeforeAll and @AfterAll behaviour with Cucumber ...
One method from our toolbox are BDD-style feature tests. A popular approach is to phrase tests in Gherkin – a human-readable, domain-specific ...
Read more >
Caused by: gherkin.lexer.LexingError: Lexing error on line 218
CucumberException: Error parsing feature file /Users/ethemtopuk/ ... test. ... cucumberFeatures(RuntimeOptions.java:235) at cucumber.runtime.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found