SonarCloud, in Azure Devops we have SonarCloud Extension version 1.8.2 (Latest)
The project in SonarCloud is Private
I added/configured the SonarCloud tasks in our Build pipeline, i see test and code coverage running during the VSO proces, i also see a test and codecoverage tab in VSO. And in VSO it contains data (result of the tests, and a % of codecoverage).
But i don’t see the code coverage show up in SonarCloud. It stays at 0.0%.
During the “Run Code Analysis” step i do see the following lines in the log:
Yeah i’m running the builds on a (own) hosted build machine. I see VSTest running, i also see the created files (test & coverage) show up in the SonarCloud code analyses task, but it isn’t showing up.
Ah, yes, sorry, i was in fact talkin about the CodeCoverage tool provided with Visual Studio Enterprise only.
You need this tool on your machine so that the scanner will be able to effectively convert your *.coverage to *.coveragexml, only understandable files by SonarCloud for code coverage (using vstest tool)
I agree that there is not that much log if we don’t find the tool (i didn’t see them on your posted logs)
Can you confirm that you do / don’t have this tool ?
I checked the local install and see that “vstest.console” is present. I also checked that the local install has a valid license.
When i check the VSO VSTest task, i see the following output.
1 thing i do see in the log is:
14:33:22.144 Found corresponding Binary-to-XML conversion output file for g:\work\29\s\TestResults\vb-admin_BDBUILDAGENT01_2019-08-29_15_51_48\In\BDBUILDAGENT01\vb-admin_BDBUILDAGENT01 2019-08-29 15_51_33.coverage, no conversion will be attempted.
Which is kinda strang regarding your earlier remark that there needs to be a conversion from *.coverage => *.coveragexml
Is there anything i can do to give you more data with which you can pinpoint the issue?
Ok so given your log output, i think i understood, at least why you get the message above.
You have two ways to give to SonarCloud your coverage file (at least by the way you are using/providing it)
Just run the vs test task, it will output, if you enable code coverage, a .trx and a .coverage files. That way, the Scanner for MSBuild will detect them, and try to convert the .coverage file to .coveragexml
Run the vs test task and convert the coverage file by yourself, before the “Run code analysis” task. That way, you choose provide the following additional property “sonar.cs.vscoveragexml.reportsPaths” in the “Prepare analysis configuration” task, so that the Scanner will discover them and parse them, otherwise, and that’s the reason why you get the message, no action will be done on the coveragexml file.
Can you try either adding the property with the path to your coveragexml files, or just not do the conversion before the Run Code Analysis task, and let us know ?
Can you provide us the full log of your Run Code Analysis task please, and with debug enabled (i’ll be perfect). Of course with redacted secure things if you have to !
I noticed (in some of the treads) that there was a new version of the Azure DevOps plugin release, i checked if it changed anything, but in my case the coverage still isn’t showing up.
Have you found anything in the logs? Or have found something else?
Is there anything i can check (recreate project (or test in a new project) ?