Closed ar4development closed 10 months ago
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
The attachments API is designed not to expose file names to end users. The reason is that there are so many other features that rely on the naming convention, for example, real-time reporting & attachment filtering features from Allure TestOps.
The recommended way to optimise the storage space is to post-process the results and remove/merge/override attachments by using the LifecycleListener
extensions.
Hint: override io.qameta.allure.listener.TestLifecycleListener#beforeTestWrite
, then iterate over TestResult
and remove all the unnecessary attachment files
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