How to correctly configure TeamCity to import test results into SonarQube Server

We are trying to import test RESULTS (so not only coverage) into a SonarQube Server instance.
First of all, is this actually possible? It seems there is some way (we found somw information but it is fragmented and/or related to previous SonarQube versions), but we cannot find a place in SonarQube where this data would be displayed.

This is our setup:

  • .NET 9.0
  • Visual Studio Build Tools 2026 18.0.2
  • SonarQube Server / Community Build v25.11.0.114957 (zip installation)
  • TeamCity 2025.07.03
  • SonarScanner for MSBuild 6.2.0.85879
  • dotnet-coverage 18.0.4+71e5e8d1463c32e18d457f414a9cf8a4b322b664

This is our relevant build step configuration:

  1. SonarScanner for MSBuild: begin analysis, with field “Additional parameters” set to:
/d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.cs.xunit.reportsPaths=reports.trx
  1. PowerShell script to run tests, collect coverage and (implicitly) analyze the code for Sonar via the dotnet-coverage tool:
dotnet-coverage collect "dotnet test PATH_TO_PROJECT_FOLDER -c DEDICATED_TEST_CONFIGURATION --results-directory . --logger trx;LogFileName=results.trx" -f xml -o "coverage.xml"
  1. SonarScanner for MSBuild: finish analysis

Both coverage.xml and results.trx are generated correctly.

SonarQube correctly processes and imports analysis data and coverage data, but NOT test results.

Hi,

No, test results are no longer imported. Many years ago they were, which is probably why you’re finding fragmentary (historical) references to them being imported.

 
HTH,
Ann

Understood; thank you for your response.