We are unable to see the code coverage for one of the dotnet project, hence the same method is being used for other dotnet projects it worked as expected and we are able to see code coverage in sonar cloud.
We are using Sonarcloud plugin in Azure devops and it is set to run with ‘Integrate with MS Build’ and these are the properties we are configuring -
extraProperties: |
sonar.exclusions=/obj/,/*.dll
sonar.cs.opencover.reportsPaths=$(Build.SourcesDirectory)//coverage.opencover.xml
sonar.cs.vstest.reportsPaths=$(Agent.TempDirectory)/*.trx
Here’s the order of things -
Prepare SonarCloud configuration
dotnet build
dotnet test - This task is running the test cases and outputting a .trx file into a temp directory. Output -