test: Migrate ParserTest fixtures to the cucumber gherkin testdata format - #427
Open
Amoifr wants to merge 1 commit into
Open
test: Migrate ParserTest fixtures to the cucumber gherkin testdata format#427Amoifr wants to merge 1 commit into
Amoifr wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #389.
This converts all 34
ParserTestfixture pairs (tests/Fixtures/features/*.feature+tests/Fixtures/etalons/*.yml) to the cucumber gherkin testdata format intests/Cucumber/extra_testdata/good/, following the approach of #322:.ast.ndjsonexpectations were generated with the official cucumbergherkin-javascriptCLI (--predictable-ids --no-source --no-pickles, piped throughjq --sort-keys -cto match the existing file format), so they are real cucumber parser output, not dumps of our own parser;good/;background.feature->background_and_untitled_scenario.featureandempty.feature->comment_without_trailing_newline.feature;legacymode only (zero divergence ingherkin-32): multiline titles folded into the title (5) and trailing whitespace trimmed from description lines (2). They are documented in$notParsingCorrectlyand theirexpected_variantswere recorded withRE_RECORD_EXPECTATIONS; I checked the recorded variants against the old YAML etalons, the semantics are identical.Each fixture is now exercised in both compatibility modes instead of one, and the previously etalon-covered behaviour is protected either by the cucumber expectations or by the recorded variants.
The loader tests used to share the fixtures folder, so they now have their own minimal
tests/Loader/Fixtures/(three features and theaddition.ymletalon they assert against). With that,tests/Fixtures/featuresandtests/Fixtures/etalonsare gone andParserTestno longer usesYamlFileLoaderat all, which unblocks #362.Note: PHPStan currently reports a pre-existing
offsetAccess.invalidOffsetonsrc/Node/TableNode.php:156that is unrelated to this change (master has not been rebuilt since the gherkin v40 / dependency bumps); happy to address it separately if useful.