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
Parsing error with comment only feature files #179
Comments
This sounds a legit issue. However I have just re-tested this on cucumber 9.0.2 and I cannot reproduce it. However I'm not certain we have done many / all fixes recently. My only thought is that we are now restricting gherkin quite aggressively in cucumber ruby because of some new bug fixes / refactors, maybe this has implicitly fixed this? Can you re-test using cucumber ruby 9.0.2 please @enkessler |
For In any case, I will continue to work around this issue by having non-empty feature files because I need to be able to use both newer and older versions of Cucumber. |
So we have a new way of doing "things" in cucumber that is presented in the CCK. We are currently looking to do 2 things. 1 - Evaluate our CCK try add new items (I'll make a note to ensure we have a comment based CCK if we don't already). EDIT: There isn't a "fat" gherkin spec nor a "thin" CCK spec for this. I'll have a chat and we need to get a new issue raised for this. 100% agree this needs doing If you want to manage / check progress or contribute feel free to |
Looking at the error message, It strikes me as more likely that this was indeed a parsing issue, in an older version of the Gherkin parser being used by the older version of Cucumber you were using. If you have the capacity to investigate the details a bit more @enkessler and send a PR to improve the UX for these older versions of Cucumber, please go ahead. I don't see an actionable change here to the Gherkin library though so I think we need to close this issue. |
Hi @mattwynne - I was planning on keeping this open as a note to get the 2 things done. Once I've got those two things done I think we should close this as then we'll be able to monitor this better |
I had something similar using the The following gave an error: @tags here
Feature: Feature decription
# This causes an error
Benefit: Some benefit
Role: To a user type
Goal/desire: That wants to achieve something
Scenario: Rest of the file omitted
Given some set-up
# This comment here is actually not an issue The error is reported for the lines that have "Benefit", "Role", "Goal". If I remove the |
👓 What did you see?
I encountered a parsing error when running a Cucumber suite that included a feature file containing only a comment line.
unexpected end of file, expected: #Language, #TagLine, #FeatureLine, #Comment, #Empty (Cucumber::Core::Gherkin::ParseError)
✅ What did you expect to see?
I expected the file to parse cleanly and have no impact on the Cucumber execution (no errors, no pickles, etc.)
📦 Which tool/library version are you using?
OS: Windows
Language: Ruby
Cucumber version: various, as needed for whatever version of
cucumber-gherkin
that I was usingGherkin versions: 9-27. All versions of
cucumber-gherkin
are affected🔬 How could we reproduce it?
Steps to reproduce the behavior:
"my_great_idea.feature"
cucumber my_great_idea.feature
unexpected end of file, expected: #Language, #TagLine, #FeatureLine, #Comment, #Empty (Cucumber::Core::Gherkin::ParseError)
📚 Any additional context?
Given that the parsing error explicitly lists
#Comment
tokens as a valid expectation at that point in the file, I am under the impression that the example feature is intended to be syntactically valid and that this is a bug in the parser.This text was originally generated from a template, then edited by hand. You can modify the template here.
The text was updated successfully, but these errors were encountered: