For our build pipeline in Azure DevOps we have switched to using the ubuntu-latest vm-image and since that switch I have noticed we no longer receive code coverage information. I have verified that the problem is due to using a Linux agent by switching back to windows and see that it worked, however due to a problem with the current Windows agents we have to use the Linux agent. Is it possible there is a problem with the default path that sonar checks for the coverage information? I don’t see any problems in the attached log. sonarlog2.txt (296.2 KB)
As you have discovered the automatic collection of coverage is only supported on Windows. Microsoft have created a new tool that is cross-platform called dotnet-coverage and we have updated the documentation on how to set it up here
I have an issue with this when I want to run it on linux agent. In the example .NET Test Coverage | SonarCloud Docs provided by sonar cloud the dotnet test job arguments: '--collect "Code Coverage"' will not work in linux that only works in windows.
+1 to this, we currently have to have 2 separate jobs to build our code twice, once on windows, once in linux due to SonarQube’s lack of support for linux. Would be great to see this fixed.