-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
with_filtered_backtrace called on Test::Result::Unknown with strange feature file #967
Comments
I was able to repro this issue on my machine and determined it was introduced in version 2.0.1. When I remove the first |
I created a PR against the cucumber-ruby-core repo correcting this error by adding a EDIT: Once that PR is merged, we will need to test to make sure that it fully addresses this issue. |
In Gherkin v4.0 the compiler does not create a pickle/test case if there are no steps in a scenario (see for instance feature file and pickles reference). Cucumber-Ruby does not use the Gherkin compiler, but maybe also the compiler of Cucumber-Ruby(-Core) should also be changed to not create test cases for scenarios without steps. |
That would probably be a more ideal solution. |
IMO the most reasonable behaviour for an empty scenario like this is an in the pickles model, this empty scenario would disappear from the results, but I don't think that's what a business user who has recorded the name of the scenario would expect to happen. I wonder if we should get rid of the |
Maybe, although I've written scenarios like this just with the intention of not letting myself forget which ones I meant to write. I didn't notice or care whether they were included in the results. |
Then again, I guess I am not really a business user, per se. |
Anyway that's an academic discussion we can have later. This looks like a good fix for @krukow's immediate problem. |
I'm looking at the core code to figure out how I can make the result undefined since I agree that would be better. Shouldn't be too hard. (Famous last words!) |
How about we merge the current solution first and then do that as a second iteration? |
Works for me. |
thanks 👍 |
Could this hide problem that should be fixed. If the |
@brasmusson I don't think so, I just think we should open a second issue to make sure the better fix stays on our radar. |
The current behaviour when running and empty scenario is that its result is |
The root cause of this issue is that when executing and empty scenario there will still be hooks executed (for instance the hooks applied by the One option for fixing this root cause (to mimic the difference when using |
Truthfully, I think it's more reasonable that the result be |
👍 Having thought about it, I don't think we can simply eliminate the concept of an We could also possibly add a new filter (on the end of that chain) that implements this new rule about empty scenarios being undefined, by just adding a test step that fails with an undefined result. |
I see a couple of arguments why Thinking ahead to parallel execution (discussed for instance in #924), the runner could in many cases be in a another process or on a another machine then the parser/compiler/UI. It that case there is a need for a specified interface between them. I think a lot of the success with the Gherkin re-write ("Gherkin 3"), parser/compiler implemented in 8 languages and counting, is due to the acceptance test data which are used to test all the implementations. I think that acceptance test data already has defined the interface from the parser/compiler/UI component to the runner component: the pickles. That is one reason why empty scenarios should no reach the runner, the other is, why send data to another machine for execution (a fairly expensive operation) when you know what is going to happen - nothing. I empty scenarios will not be sent to the runner in that case, why do it just because the parser/compiler/UI and the runner executes in the same Ruby interpreter? I also like to point out that with the event based formatter like https://github.com/cucumber/cucumber-pretty-formatter, the formatter get the content of the feature file passed separate from the data from the runner, so such a formatter are able to determine whether any scenarios in the feature file was not executed. It may not easy/possible for the formatter to determine why, did not match tag expression, fail fast options used and failure occurred, empty scenario, etc, but as least it can determine what was not executed. |
…nd outstanding cucumber issue: cucumber/cucumber-ruby#967; fixed scenario grouping tests
|
I've manually tested Karl's bug and this should now be fixed in the next release. We can discuss this other issue (about how to handle scenarios without steps) elsewhere. |
got rid of empty scenarios as it was causing an issue in cucumber (cucumber/cucumber-ruby#967). updated tests to use new line numbers because of empty scenario issue.
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. |
To reproduce, create a trivial feature file:
edit the file to become:
and run dry-run:
cucumber -d
so you get:
The text was updated successfully, but these errors were encountered: