How do I get a code coverage report file for Azure DevOps?
CSP
Posts: 1 New member
I'm setting up CI/CD using SQL Change Automation on Azure DevOps. How do I get a code coverage report input file to the Publish Code Coverage Results task to get code coverage integrated with the Azure DevOps web portal?
Answers
Can I ask, are you referring to SQL Code coverage?
If that's so, I can point you in the direction of some tools and articles that will help with your scenario, please be aware I've not tested any of this and it's purely theoretical and I'd be keen to know if it works!
So we have an open-source tool SQL Cover here:
https://documentation.red-gate.com/sca/deploying-database-changes/automated-deployments-with-sql-change-automation-projects/use-sqlcover-with-sql-change-automation-powershell-cmdlets
So SQL Cover will output to OpenCover format, in the document, there's a link to the GitHub page that gives you the ReportGenerator.exe which can convert to formats such as Cobertura which is supported by ADO, these can then be published by Azure DevOps.
The following article may also be of interest surrounding this subject: https://nielsnijveldt.github.io/display-opencover-results-in-azure-devops/
Kind regards
Dan Calver | Redgate Software
Have you visited our Help Center?