-
Notifications
You must be signed in to change notification settings - Fork 95
test: Handle optional tableHeader when loading NDJson examples #294
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
test: Handle optional tableHeader when loading NDJson examples #294
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delay on this @uuf6429
Code-wise it looks good bar a small tweak to the test, and I agree that it's better to throw an exception than the current PHP warning / errorhandler call.
However I'm a bit confused if this is valid / if it will cause us to lose parity with upstream cucumber (or if it's just a theoretical case that can't actually ever be triggered by a valid Gherkin file)?
I can see from the links you posted in #286 that it does seem the table header is officially not required - and I share your confusion about how that can be the case, since as you say a Gherkin table header is always just the first row, there's no syntax to have a table that only has a body.
The docs at https://cucumber.io/docs/gherkin/reference/#scenario-outline also suggest the header is required:
the Scenario Outline is run once for each row in the Examples section beneath it (not counting the first header row).
I can't find anything in the cucumber/messages issues or PRs to explain this. Notably, it looks like the tableBody was originally also not required and was added later - I wonder if the header has just been overlooked?
Were you able to get a better understanding of what's going on here? Is it maybe worth opening an issue on cucumber/messages to check if this is something we should actually be handling rather than rejecting?
This comment was marked as outdated.
This comment was marked as outdated.
Codecov ReportAll modified and coverable lines are covered by tests β
Additional details and impacted files@@ Coverage Diff @@
## master #294 +/- ##
============================================
+ Coverage 96.23% 96.36% +0.13%
- Complexity 598 600 +2
============================================
Files 35 35
Lines 1751 1763 +12
============================================
+ Hits 1685 1699 +14
+ Misses 66 64 -2
Flags with carried forward coverage won't be shown. Click here to find out more. β View full report in Codecov by Sentry. |
ca3a37f to
032113a
Compare
|
@uuf6429 I have to say I'm still not sure what's going on here - it does look like I think we should at least hold off on this till #306 is merged with the latest cucumber/gherkin examples. I would then be tempted to just throw if the key is not present so that we can review it if/when it arises, rather than assuming what the structure might look like without an example of that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@uuf6429 thanks, this looks very close to me - a couple of things I spotted (sorry if I'm missing something)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @uuf6429 this is great now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closes #286 (refer there for details).