Azure DevOps: How to merge two code coverage reports for different tests (.net core, angular)
Asked Answered
E

1

12

We have two different types of tests in pipeline: unit(.net core) and frontend (angular/karma). Each of them can publish code coverage report via to "PublishCodeCoverageResults@1", but only one front or back. It depends on which test runs last. I think the last coverage owerwrites previous. However we need both code coverage publish.

Is there way to merge 2 coverage report and then publish them in one Code Coverage tab or add the second tab?

Employee answered 30/9, 2019 at 10:33 Comment(0)
T
13

Is there way to merge 2 coverage report and then publish them in one Code Coverage tab or add the second tab?

AFAIK, ReportGenerator can merge multiple coverage files into one, e.g. merge several Cobertura XML files into just one Cobertura XML file:

Check the document ReportGenerator for some more details.

You can do the following steps in the Azure devops:

Currently the Publish code coverage results task regenerates the HTML report. To avoid that, you have to create a new environment variable: disable.coverage.autogenerate: 'true'

Check this thread for some more details.

Hope this helps.

Troth answered 1/10, 2019 at 6:4 Comment(1)
Can you generate Angular and .Net Core summary files and show them in AzureDevops?Tineid

© 2022 - 2024 — McMap. All rights reserved.