danielpalme / ReportGenerator

ReportGenerator converts coverage reports generated by coverlet, OpenCover, dotCover, Visual Studio, NCover, Cobertura, JaCoCo, Clover, gcov or lcov into human readable reports in various formats.
https://reportgenerator.io
Apache License 2.0
2.65k stars 283 forks source link

Unable to convert opencoverxml file into corbertura.xml file using ReportGenerator in Azure Devops Pipeline #656

Closed SatheshSelvaraj closed 8 months ago

SatheshSelvaraj commented 8 months ago

Hi All,

We are working on TSQL code coverage, and successfully generated the opencoverxml file using powershell task. But we are unable to convert the opencoverxml file into cobertura file to publish into SonarQube report, its missing with line of coverage data while using the report generator tool via Azure DevOps pipeline. Can you please assist on this request.

To Reproduce The following input helps to reproduce your issue:

  1. Console output of ReportGenerator, we have create the task to convert opencoverxml to Cobertura. Screenshot pipeline task

post conversion the line of code is not covered and piblished.

image

The output file that we are getting through HTML and XML, but it is unable to convert into Cobertura file using report generated. We can able to publish the code coverage only if it is converted into cobertura.

HTMLXMfile-correct output.zip

  1. If the issue is related to a specific coverage file which gets parsed by ReportGenerator, you can share the file: Opencover XML file send through the Email
danielpalme commented 8 months ago

Thanks for your sample files.

The problem is/was that the listed files in the OpenCover file do not exist on disk (e.g. [dbo].[sp_alterdiagram]). Therefore ReportGenerator is not able to read the file which resulted in an empty <lines /> element.

I changed the behavior now. If a file does not exist at least the lines from the OpenCover file are represented in the Cobertura output.

Please try again. And I would be happy if you update your review to 5 stars :-)

SatheshSelvaraj commented 8 months ago

Hi danielpalme,

Thank you for your help. We are able to publish the correct report now. Much appreciated on your kindly support.

Thanks

danielpalme commented 8 months ago

Awesome!