Sonar scanner for .NET not able to display code coverage


Coverage is not taken into account by sonarScanner for .net in Bitbucket pipelines.

I am using Bitbucket as CI/CD tool and in the pipeline I run sonarScanner to scan my tests. All results are displayed as you can see in the screenshot below, but coverage is not taken into account, according to the documentation here I saw that the tests files are automatically retrieved according to a search pattern and can only work for .NET >=4.6.1, which is not a problem since I use 4.6.1.

The test is run using the dotnet test path-to-the-test-project command.

Since I was not able to get the report automatically, after reading this documentation on (coverlet)[GitHub - coverlet-coverage/coverlet: Cross platform code coverage for .NET] I installed coverlet and updated the test command to dotnet test path-to-the-test-project /p:CollectCoverage=true. but I am still not able to display the report.

Please, does anyone know what I am missing ?

Thank you for reading me,

Hey there.

Your screenshots didn’t seem to make its way into your post in the end – can you repost it?

I just updated it, it’s showing now. Thanks

Hey there.

Sorry for the delayed reply. Can you show me how your pipeline is configured (the bitbucket-pipelines.yml file?)