Colin
(Colin)
January 27, 2022, 10:18am
2
Hey there.
SonarCloud only reads coverage reports – it isn’t responsible for producing them. Are you successfully generating code coverage reports today, and taken the steps to import them?
To include test coverage in your analysis, you’ll need to:
provide the relevant analysis parameter to the SonarScanner for MSBuild begin step
execute your unit tests just after build and before the SonarScanner for MSBuild ’s end step.
We support:
Import of coverage reports from VSTest, dotCover, OpenCover, Coverlet, Altcover and NCover 3.
Import of unit test results from VSTest, NUnit and xUnit.
We’ve documented here for each engine:
what is the relevant analysis parameter to pass during…
As explained in our Test Coverage documentation, SonarQube/SonarCloud does not run tests or generate reports, but imports pre-generated reports from another source. The goal of this guide is show how to troubleshoot and correct typical code coverage import issues into SonarQube/SonarCloud for C# and VB.NET languages. If you are interested in troubleshooting unit test results and execution reporting instead, see “Import unit test results” section of [Coverage & Test Data] Generate Reports for C#,…