PROTOTYPE: Cucumber messages v32.0.1 with changes to attachment handling#1015
PROTOTYPE: Cucumber messages v32.0.1 with changes to attachment handling#1015clrudolphi wants to merge 18 commits intomainfrom
Conversation
…Messages 31.1.0 and HtmlFormatter 22.3.0. This supports the addition of the Location property to Pickles. Updated Formatters.Tests to use the latest release of the CCK scenarios and samples.
…atuses scenario and other minor restructuring)
…MessagePublisher. The MessageBroker combines the attachment handling behavior options of registered formatters. The FormatterBase intercepts MessageEnvelopes when published and substitutes the appropriate type of Attachment message.
Adapted Formatter test infrastructure to the addition of the new Message type.
…ttachmentHandlingOptions' section.
|
Nitpick Maybe instead of "attachmentHandlingOptions": {
"attachmentHandling": "External",
"externalAttachmentsStoragePath": "path/to/CucumberMessages/Attachments"
}This would be more clear and clean IMO: "attachmentHandling": {
"mode": "External",
"attachmentsPath": "path/to/CucumberMessages/Attachments"
} |
Not at all! That's a really good idea. |
…nt Envelopes instead of stuffing both attachment types into a single envelope.
|
I want to come back to this prior to a v4 release. I have rethought this and I am leaning towards scrapping this PR and proceeding in a different direction.
Any objections? Thoughts? |
I think I disagree. The unit test providers maybe don't move the files, but VsTest and the TRX logger does copy the files to the test results folder. So as a result the test results folder - with the TRX file and the related subfolders contain a standalone copy of the "logical test result". In our case, the HTML/NDJSON file was the standalone "logical test result" so it was good that we embedded the attached files into that. The new feature in Cucumber Messages is about providing an option to extend the meaning of "logical test result" to multiple file system files. It is now our decision if we want to use this option or not. (Side note: The external embedded files are not yet supported by many downstream Cucumber Messages tooling, so by using the "external" option for almost all attachments would cause issues.) Seeing the problem now, after some time, I think we should just upgrade Cucumber Messages and keep using the embedded attachments for now (so not use the new feature). We can reconsider using the external one later, once we will better see how other tools support it. |
OK. I've parked #1015 (this PR) and #1056 (which is an alternative take on how to support external attachments, which I suspect you'll like even less). Please do review #984 as that PR is the one that updates to all the latest Cucumber dependencies (without changing how we emit attachments). |
That one is already approved by me. I was waiting for the release decisions with the merge. Let's discuss this on Discord. |
🤔 What's changed?
This is early prototype. This branch depends upon the branch from PR #984 (as that one has other Cucumber upgrades that are prerequisites to this).
Adds support for Cucumber.Messages v32.0.1 and the new Message type 'ExternalAttachments'
New configuration will be available, such as:
There is a new section called 'attachmentHandlingOptions'. The 'attachmentHandling' property could be None/Embed/External
If External the 'externalAttachmentsStoragePath' is used when crafting ExternalAttachment objects.
The overall idea is that users will call
IReqnrollOutputHelper("pathToAttachment");The presumption is that this 'pathToAttachment' is given to the underlying test frramework (such as NUnit) and that it might copy/move that attachment to a permanent location that the report should reference.
Thus with the 'externalAttachmentsStoragePath', we're asking users to tell us where the test framework will place the attachments (post-test run).
Custom formatters that inherit from
FormatterBasewill be able to programmatically override that setting and/or override how attachment handling works overall.⚡️ What's your motivation?
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
anything;
📋 Checklist:
This text was originally taken from the template of the Cucumber project, then edited by hand. You can modify the template here.