-
-
Notifications
You must be signed in to change notification settings - Fork 81
(dotnet) Migrate gherkin messages to cucumber messages #426
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
(dotnet) Migrate gherkin messages to cucumber messages #426
Conversation
|
Tests run locally are successful. I'm not sure, from reading the build log, why the test-dotnet job failed. Can anyone help me out? |
Produced an AST with Is there perhaps a conflict between https://github.com/cucumber/gherkin/blob/main/dotnet/Gherkin/StepKeywordType.cs and https://github.com/cucumber/messages/blob/main/dotnet/Cucumber.Messages/generated/StepKeywordType.cs with the json deserializer only picking up the instructions for the enum from messages? Why this only happens in the french feature files is indeed a bit puzzling. |
mpkorstanje
left a comment
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.
Some remarks see below. I don't see anything major.
Without looking further into the details, I think that might be another bug actually. Something along the lines of #400. I think that if you try to replace the
And this is probably because some lookup is stored in a map or set with non-determistic ordering. |
|
On inspection this looks suspicious: gherkin/dotnet/Gherkin/GherkinDialect.cs Lines 40 to 49 in c06186f
By using Again apologies for any vagueness. I can't actually run this code locally. |
Changed `Io.Cucumber.Messages.Types` to alias `MessageTypes` for clarity. Updated enum converters in `NDJsonParser` to use the new alias. Modified `Gherkin.csproj` to allow automatic updates for the `Cucumber.Messages` package by changing the version to `28.*`.
Actually the cause is simple, but not sure of the path forward. My doubt however is why this hasn't surfaced for the other implementation languages that have already adopted Messages. Their tests too should show a difference between what is output and what the acceptance files have as content. |
|
I had not tried previously to regenerate the .net parser, so I attempted that by following the directions on the Contributing.MD page (spinning up a docker container and running the make commands). Was that a mistake? |
This PR writes the uppercased enum names. The expected value is the pascal cased description on the enum constant. So presumably the serialisation isn't done correctly. The other implementations do seem to do this correctly.
Did you try to downgrade that again? |
The starkey word is kinda special because its step type is unknown. How different implementations handle this seems to be inconsistent. This should highlight some problems.
Co-authored-by: M.P. Korstanje <mpkorstanje@users.noreply.github.com>
Co-authored-by: M.P. Korstanje <mpkorstanje@users.noreply.github.com>
Consolidated enum conversion into a factory in order to simplify setting up JsonSerializerOptions. Refactored `NDJsonParser` to use a static `SerializerOptions` property, enhancing maintainability. Modified the Gherkin CLI to utilize the new serialization options when printing events.
…thub.com/clrudolphi/gherkin into migrateGherkinMessagesToCucumberMessages
I found the problem within the CLI section of the testing project. It was using a default enum converter. I've changed that to use the proper one for the Messages enums. All tests pass now. |
More a a lack of test coverage. Renovate proposed several updates.
Fixed with 34af477. |
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.
Looks good to me. But I assume you'll want to fix the StepKeywordType? If so I'll hold off on merging until that is done.
I haven't looked into this, but consider it out of scope for this PR. This is within the parser and not anything I'm touching right now. |
|
@mpkorstanje I've updated the handling of StepKeywordType as I understand it should be done. Please reconfirm. |
No problem. Made #435 to address that. |
…into migrateGherkinMessagesToCucumberMessages
🤔 What's changed?
This PR enhances the .Net implementation such that the Message events and pickles that are generated use the
Cucumber/Messagestypes instead of theGherkin.Cucumber.Messages.Typeswhich had been embedded in the Gherkin project.⚡️ What's your motivation?
Parity with other implementation languages.
This will also simplify the Reqnroll implementation of Messages.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.