Closed Sigill closed 2 years ago
This PR is closed without merging.
The PR was the last of sequence of four PRs, that had to be merged in a specific sequence as each PR in the series depended on the previous one having been merged before.
Since the second and third PR have been closed without merging, there is no point in merging this one. If this functionality is required first the two other PRs need to be revived before it makes sense to have another look at this one.
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 (cucumber/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: