SonarCloud doesn't show Unit Tests when using TRX report generated by .NET Core 3.1

  • ALM: GitHub
  • CI: GitHub Actions
  • command:

GitHub Action

- name: SonarCloud Scan
  uses: sonarsource/sonarcloud-github-action@master
    env:
      GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

Test Logger:
dotnet test “Tests.csproj” --logger “trx;LogFileName=testresults.trx” --results-directory /TestResults

Example TestResults.zip (1.9 KB)

SonarCloud log file:

INFO: Parsing the Visual Studio Test Results file ‘/github/workspace/./TestResults/testresults.trx’.
INFO: Sensor C# Unit Test Results Import [csharp] (done) | time=104ms

SonarCloud GUI doesn’t show any information about number of unit tests.

I can successfully import Code coverage using generic format
image

Could you please advise what format shall I use in dotnet test command to see the test statistics in SonarCloud?
Is it required to use a different one?

I’ve seen this this blog post from Aug 2019 suggesting that out-of-the-box SonarCloud cannot import TRX files generated by .NET core 3.1

Have you got any suggestions?

Thanks,
Mau

Hi @maulemon and welcome to the forum. You can see this (controversial) thread on our github repo. We don’t push that data to :sonarqube: / :sonarcloud: , and our decision has been not to push it.

Great!

Hi @Andrei_Epure,

It’s not the outcome that I was hoping for but I’ve added my comment directly to GitHub repo :slight_smile:

Thanks,
Mau

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.