- 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
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