UnitTest number always 0

  • Azure DevOps service
  • Sonarcloud installed in Azure DevOps Marketplace

In the azure DevOps step “SonarCloudPrpare” I set the sonar.cs.vstest.reportsPaths=$(Common.TestResultsDirectory) this way the step “SonarCloudAnalyze” can find the .coverage file and in the SonarCloud the Code Coverage is shown.

So far so good.
But in SonarCloud the Unit Test number remains 0 even there are two Unit Tests listed in the .trx file already referenced and consumed from the SonarCloudAnalyzer. So what i’m missing that the Unit Test number shows 2 like Azure DevOps already does and the .trx file has in?

You should have a look at this guide: [Coverage & Test Data] Generate Reports for C#, VB.net for this issue.