Added customization of source file name pattern #963
Closed
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.
Context
Currently the attachment filename pattern is hardcoded in
AllureLifecycle#prepareAttachment
method. Despite it if perfectly matchesio.qameta.allure.AllureResultsWriter#write(java.lang.String, java.io.InputStream)
specification in some cases we might need to customize the value.For example: we have tests with numbers of steps where all those steps return same result. We do not want to keep different files for all those attachments since it overloads storage and network. So we would like to use some logic that would evaluate the attachment name depending on the content so that same content would be stored in the same file.
I understand that current implementation of
io.qameta.allure.FileSystemResultsWriter
does not allow to use attachment files with the same name. However I keep that out of the scope of current PR since I expect that whoever addressing the use case like mine would use their own writer which would be able to overwrite existing attachment files.Checklist