Implement the official gherkin parser#698
Conversation
…n public API and current codebase as much as possible)
|
🧙 Sourcery has finished reviewing your pull request! Tips
|
There was a problem hiding this comment.
We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.
|
@youtux please let me know if this is the right way to go. |
…f available data and implementing features.
…s removing tabbing from docstring in steps (aka multiline steps)
|
Finished tinkering and fixing things for the CI jobs :) |
|
@sourcery-ai review |
There was a problem hiding this comment.
We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.
youtux
left a comment
There was a problem hiding this comment.
Good stuff! A few comments, but we are in the right track! Thank you for your effort
|
I'll take a look into your comments. Most I can already see I agree with. I was in 2 minds about Pydantic - it's made model validation much easier when ingesting the gherkin document dict, but I can absolutely see your point. I will have a look :) |
|
Thank you for your feedback and time to look at this, @youtux! I've resolved most comments - just a couple of things:
|
youtux
left a comment
There was a problem hiding this comment.
can you also add a changelog entry in CHANGES.rst with all the backwards incompatible changes?
So far I could see that we don't accept spaces in tags and that now Feature: is required in the feature file definitions.
Also bump codecov-action
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #698 +/- ##
==========================================
- Coverage 95.37% 95.23% -0.14%
==========================================
Files 50 53 +3
Lines 1838 1994 +156
Branches 201 228 +27
==========================================
+ Hits 1753 1899 +146
- Misses 53 58 +5
- Partials 32 37 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
They are not really failures, just deprecation warnings that we treat as errors.
94bf691 to
d11096f
Compare
Fix test file name
…erkin-official-parser
# Conflicts: # CHANGES.rst
|
Congrats! We are now using the official parser! |
|
Thank you, @youtux 🙌 |
Implementation of the official Gherkin parser.
Trying to maintain the public API and current codebase as much as possible. I was thinking little steps, and introduce new features/refactoring after we know it works like-for-like with current feature set.
Credit to @elchupanebrej for his implementation I referenced in pytest-bdd-ng
Breaking changes
Some of the previous features that are not Gherkin-compliant I had to remove. I have tried to find workarounds where possible.
Changes include:
NB: This simply replaces the parsing logic with the Gherkin official parser, but the current parser does some additional logic and makes custom entities that are needed for test execution. I have coerced the Gherkin Document data to the existing model (minimising change), but I have raised a new MR (#699) that completely removes the existing parser to replace with Gherkin Document data generated. Not sure which is best route to take.