coverlet-coverage / coverlet

Cross platform code coverage for .NET
MIT License
2.99k stars 386 forks source link

Solution based merging for data collector #1676

Open daveMueller opened 3 months ago

daveMueller commented 3 months ago

closes #1307

daveMueller commented 3 months ago

I guess I need some additional feedback/help here. The main problem is that I still don't fully understand how it is intended to implement IDataCollectorAttachmentProcessor. I see it beeing executed for every test project where the attachment then only is the projects test result. And also it gets executed once for the whole solution where the attachments are all the test runs results. Thus I could only check if attachments > 1 and then merge all of them together. But from previous discussions it seems like there could be intermediate results that need to merged. Therfore I added now a new runsettings option called MergeDirectory to store intermediate results. The idea behind that is that everytime the attachment processor triggers all attachments are merged plus the intermediate result in the MergeDirectory. The result of this merge is the new intermediate result. Unfortunately the MergeDirectory path must be an absolute path so that this works reliable. If it is a relative path, the location changes depending on the if the processor is triggered from a project or from a solution. cc: @MarcoRossignoli @bert2

MarcoRossignoli commented 3 months ago

Therfore I added now a new runsettings option called MergeDirectory to store intermediate results. The idea behind that is that everytime the attachment processor triggers all attachments are merged plus the intermediate result in the MergeDirectory. The result of this merge is the new intermediate result.

Why you need intermediate? take the directory from the first of the 2 attachments you receive and save in the same directory removing the 2 and send back. Something like a reduce. Attachments usually are inside the result directory specified in the config.