Skip to content
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

Use Gherkin parser as soon as it becomes available #73

Open
ehuelsmann opened this issue Feb 9, 2016 · 13 comments
Open

Use Gherkin parser as soon as it becomes available #73

ehuelsmann opened this issue Feb 9, 2016 · 13 comments
Milestone

Comments

@ehuelsmann
Copy link
Collaborator

The cucumber project started "Gherkin3", a project which allows to consistently parse Gherkin .feature files across languages (https://github.com/cucumber/gherkin).

ehuelsmann added a commit to ehuelsmann/test-bdd-cucumber-perl that referenced this issue Feb 9, 2016
@pjlsergeant
Copy link
Collaborator

Work in progress here: https://github.com/pjlsergeant/gherkin/tree/master/perl

@pjlsergeant pjlsergeant self-assigned this Feb 20, 2016
@pjlsergeant
Copy link
Collaborator

This will break use of "Scenario" to mean "Scenario Outline", so I'm unsure about this.

@ehuelsmann
Copy link
Collaborator Author

The Gherkin release notes suggest that in Gherkin 6 Scenario Outline vs Scenario has been resolved:
https://github.com/cucumber/cucumber/blob/master/gherkin/CHANGELOG.md#6013---2018-09-25

ehuelsmann added a commit that referenced this issue Aug 20, 2019
This item has already been logged as issue #73
@ehuelsmann ehuelsmann added this to the 1.0.0 milestone Aug 31, 2019
@ehuelsmann ehuelsmann changed the title Use Gherkin3 parser as soon as it becomes available Use Gherkin parser as soon as it becomes available Sep 2, 2019
@ehuelsmann
Copy link
Collaborator Author

After cucumber/common#694 gets merged the Gherkin parser has everything we need to drive cucumber tests: the generated pickles list all the scenarios and their steps that will be executed. This will also eliminate the need to parse Gherkin "ourselves".

@ehuelsmann
Copy link
Collaborator Author

I'm only inclined to go this way if we can have the protobuf library required to produce the wire protocol data be an optional component in the ecosystem.

@ehuelsmann
Copy link
Collaborator Author

An alternative would be to test our parser with the central testing corpus.

@ehuelsmann ehuelsmann removed this from the 1.0.0 milestone Dec 28, 2020
@ehuelsmann
Copy link
Collaborator Author

There's a fully updated Gherkin parser available now on CPAN!

@ehuelsmann ehuelsmann added this to the 1.0.0 milestone Feb 7, 2021
@ehuelsmann
Copy link
Collaborator Author

ehuelsmann commented Jul 19, 2021

BTW, changing to the new parser also means to support the Rule keyword, bit at the same time has a big impact on the rest of the program due to the fact that Gherkin has a different setup for the AST of the feature file.

For the execution, things will become simpler, because we will be handed pickles to be expanded into test cases and executed from the there. For the formatters (harnesses), things will be very different as they will need to combine AST data with test results to print scenarios and rules with their outcomes.

@ehuelsmann
Copy link
Collaborator Author

As noted in cucumber/common#768, we need the pickles to be expanded, because the steps in the pickles don't hold a keyword whereas we have always used the keyword for dispatching the correct step function.

@ehuelsmann
Copy link
Collaborator Author

With the merge of cucumber/common#1741, the data that we need is now available in the pickles! All we need is a release and some effort to replace our own parser with the one published by the Cucumber project!

@ehuelsmann
Copy link
Collaborator Author

As of Gherkin 24.0.0 (released to CPAN today) all prerequisites are there to move to the parser from the Cucumber project!

@pjlsergeant
Copy link
Collaborator

Great work @ehuelsmann :-D

@ehuelsmann
Copy link
Collaborator Author

First step towards using Cucumber infrastructure taken: released 0.85 today which uses Cucumber::TagExpressions tag expression parser and evaluator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants