Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
SatheshSelvaraj opened this issue Mar 14, 2024 · 3 comments

Comments

@SatheshSelvaraj
Copy link

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
Copy link
Owner

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
Copy link
Author

Hi danielpalme,

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

Thanks

@danielpalme
Copy link
Owner

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants