Hello!
I have multiple tests projects - one with unit tests and one with integration tests. How can I calculate code coverage for both projects with coverlet?
This is especially important if attempting to upload test results to VSTS, which is expecting a single summary file (and grabs the last match if using a glob pattern).

is there an API to hook in to once all tests are complete? i guess currently a single instance of coverlet doesn't know if it's the last time a test is called and would need to consolidate the results for every test project.
We run several tests in parallel using gitlab CI so would like to take the output files and combine them to give an overall result. Would be nice if this were possible.
I'm exploring various possible ways to achieve this. Any ideas are welcome
While I would also appreciate having this feature, currently as a workaround we are using ReportGenerator (4.0.0-alpha3) to merge all the coverage.xml files to generate a consolidated report.
From an implementation point of view, I like how opencover merges/appends output on existing report files if a -mergeoutput parameter is set.
+1 Any idea - how union coverage results? :)
@aptester's suggestion works well for generating a report. But not a combined xml for VSTS unfortunately :(
@tonerdo What do you think about it? Do you have any suggestions for it? Thx.
i want this so bad! :wink:
I'm gonna explore how existing tools achieve this and see how best to implement since it's a popular ask. Will go a lot faster if I can get some help 馃槃
I've started something over here, which I'm currently testing and will PR if ready. This basically allows one to merge the coverage result of one run, with an intermediate result of a previous run.
It's somewhat similar to what OpenCover offers.
Note that this will still generate the 'final' report after each intermediate run, so there is overhead. To use it, you should just add /p:CoverletIntermediateResult=output.json to the arguments.
Awesome @basilfx, thanks a lot for the help
The PR is here: https://github.com/tonerdo/coverlet/pull/123.
@basilfx can you please point me to the where OpenCover documents its implementation of this feature? Thanks
You can find it here: https://github.com/opencover/opencover/wiki/Usage
Look for -mergeoutput and -mergebyhash.
Most helpful comment
I'm gonna explore how existing tools achieve this and see how best to implement since it's a popular ask. Will go a lot faster if I can get some help 馃槃