Code Coverage from Blazor App - Azure DevOps CI

We have a .NET Blazor web app that we are trying to set up a new baseline scan in SonarCloud.

We have this running in an Azure DevOps CI Pipeline that runs a ‘dotnet test‘ task, and has the ‘–collect “Code Coverage”’ argument. This produces a ‘.coverage’ file that displays properly in the pipeline: about 12% coverage of 18,000 lines, currently.

Using this guide, .NET test coverage & SonarCloud, I would expect that result to be acceptable for SonarCloud.

However, with no additional configurations/exclusions on our side, SonarCloud is only identifying 11 files and 500 lines in the code coverage calculation. Despite me being able to see all the files in the code tree. It also appears that the razor pages might be ignored for code coverage, is that accurate?

Happy to provide more detail if necessary, but I can’t seem to figure out what I’m missing that is resulting in such a large discrepancy, any insight would be greatly appreciated. Thanks in advance.

Hey there.

What do the logs say about importing code coverage?