-
-
Notifications
You must be signed in to change notification settings - Fork 21
Add Suggestion message #329
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
base: main
Are you sure you want to change the base?
Conversation
Cucumber implementations helpfully generate code to implement undefined steps. As we move to message based formatters, they should be able to provide these snippets to the user as well.
09028d2
to
432e2f6
Compare
I feel I need a bit more context and explanation of the intent and presumed implementations. Is a Is it expected that a Is it expected that a |
The
So this message must be emitted after the How the snippets are presented would depend on the tool consuming the messages. The suggested snippets might indeed get quite repetitive. And consumers should account for that. It would be sensible to only emit snippets for undefined steps as they are executed. But again this is implementation dependent. For example Cucumber JVM emits the snippets prior to the execution of any steps in a pickle, but that pickle is almost certainly going to be executed. |
"description": "A unique id for this suggestion", | ||
"type": "string" | ||
}, | ||
"pickleId": { |
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.
Is pickleId
strictly necessary given we have pickleStepId
? Thinking about TestStep
which has the latter and not the former.
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.
Mmh. Worth considering.
], | ||
"properties": { | ||
"language": { | ||
"description": "The programming language of the code", |
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.
Would it be worth saying this should be a lowercase identifier like java
, typescript
or ruby
such that it would work with syntax highlighters like Prism without being remapped?
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.
Yes. That's exactly what I was looking for.
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.
LGTM
⚡️ What's your motivation?
Cucumber implementations helpfully generate code to implement undefined steps. As we move to message based formatters, they should be able to provide these snippets to the user as well.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
I didn't quite follow the design in cucumber/common#2272 and I've aggregated the snippets for each pickle step into a single suggestion. This makes it easier to use the snippet type internally as the snippet generator can now generate snippets without knowing about the other parts of the event.
This does come with an implicit assumption that there is one suggestion per execution per undefined step. Does that assumption hold?
📋 Checklist: