Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@uuf6429
Copy link
Contributor

@uuf6429 uuf6429 commented Mar 1, 2025

Closes #286 (refer there for details).

@uuf6429 uuf6429 marked this pull request as ready for review March 1, 2025 11:17
Copy link
Contributor

@acoulton acoulton left a 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?

@uuf6429

This comment was marked as outdated.

@uuf6429 uuf6429 marked this pull request as draft May 3, 2025 22:31
@codecov
Copy link

codecov bot commented May 4, 2025

Codecov Report

All modified and coverable lines are covered by tests βœ…

Project coverage is 96.36%. Comparing base (38b23b3) to head (9816767).
Report is 1 commits behind head on master.

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     
Flag Coverage Ξ”
php8.1 96.36% <100.00%> (+0.13%) ⬆️
php8.1--with=symfony/yaml:^5.4 96.36% <100.00%> (+0.13%) ⬆️
php8.1--with=symfony/yaml:^6.4 96.36% <100.00%> (+0.13%) ⬆️
php8.2 96.36% <100.00%> (+0.13%) ⬆️
php8.3 96.36% <100.00%> (+0.13%) ⬆️
php8.4 96.36% <100.00%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@uuf6429 uuf6429 force-pushed the bugfix/verify-optional-table-header-exists branch from ca3a37f to 032113a Compare May 4, 2025 10:43
@uuf6429 uuf6429 marked this pull request as ready for review May 4, 2025 10:56
@uuf6429 uuf6429 requested a review from acoulton May 4, 2025 10:56
@acoulton
Copy link
Contributor

acoulton commented May 4, 2025

@uuf6429 I have to say I'm still not sure what's going on here - it does look like tableHeader is still always present in the cucumber .ndjson files right up to 32.1.1 - and the table is definitely split between header & body.

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.

@uuf6429 uuf6429 marked this pull request as draft May 5, 2025 10:05
@uuf6429 uuf6429 marked this pull request as ready for review May 5, 2025 21:31
Copy link
Contributor

@acoulton acoulton left a 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)

@uuf6429 uuf6429 requested a review from acoulton May 13, 2025 20:27
Copy link
Contributor

@acoulton acoulton left a 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

@acoulton acoulton requested a review from carlos-granados May 14, 2025 19:41
Copy link
Contributor

@carlos-granados carlos-granados left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @uuf6429 and @acoulton for all your work around this

@acoulton acoulton changed the title Handle optional outline table header test: Handle optional tableHeader when loading NDJson examples May 16, 2025
@acoulton acoulton merged commit ef0b52f into Behat:master May 16, 2025
10 checks passed
@uuf6429 uuf6429 deleted the bugfix/verify-optional-table-header-exists branch May 16, 2025 07:16
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

Successfully merging this pull request may close these issues.

CucumberND table headers might be missing

3 participants