Add ability to send embeddings through the wire protocol #223
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.
Summary
Motivation and Context
I'm looking into cucumber-cpp for my company.
We need to be able to embed text or images into the reports, but that feature is not available when using the wire protocol.
This patch is the 4th of a series of 4, respectively impacting cucumber-ruby, cucumber-ruby-core, cucumber-ruby-wire and cucumber-cpp.
Basically, the idea is to allow embeddings to be specified in the success or fail responses sent through the wire protocol. E.g.:
The patch on cucumber-ruby (cucumber/cucumber-ruby#1354) will let formatters access embeddings stored in a step result.
The patch on cucumber-ruby-core (cucumber/cucumber-ruby-core#170) will store in the step result the embeddings returned by the step invocation.
The patch on cucumber-ruby-wire (cucumber/cucumber-ruby-wire#20) will allow the embeddings stored in the wire response to be returned by the wire-based step invocation process.
The patch on cucumber-cpp (#223) will allow C++ steps to send embeddings through wire responses.
Note: embeddings were not considered to be useful for pending steps, but support should be possible if required.
Details
This patch:
invokeStep()
method to return anInvokeResult
instead of relying on implicit success or exceptions.embed()
function to allow steps to declare embeddings. The embeddings of a step are temporarily stored within that step.InvokeResult
, then in theWireResponse
object.WireResponse
in the packet to be sent.Patches on cucumber-ruby, cucumber-ruby-core, cucumber-ruby-wire have been submitted for integration in cucumber 4.x, but the changes on cucumber-cpp should be backward compatible with cucumber 2.x. Embeddings will just be ignored.
How Has This Been Tested?
Unit test on the redesign of the
invokeStep()
method, serialization of embeddings and creation ofWireResponse
fromInvokeResult
.Still need to look at E2E tests (suggestions welcomed).
Types of changes
Checklist: