Unit Test Success (%) does not appear for C#, .NET in Measures/Coverage/Tests

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Sonarqube Community Edition v10.6 (92116)

  • how is SonarQube deployed: zip, Docker, Helm
    zip in Windows 10

  • what are you trying to achieve
    See “Sucess” in Measure/Coverage/Tests, like img below, but for .net/csharp:

  • what have you tried so far to achieve this
    I tried several scripts like:

set SONAR_PROJECT_KEY=api_csharp
set SONAR_HOST_URL=http://localhost:9000
REM SONAR 10.6 community
set SONAR_TOKEN=sqp_cb8264b9693aaf51c2ca78cae9773752e913248e

dotnet sonarscanner begin ^
	/k:"%SONAR_PROJECT_KEY%" ^
	/d:sonar.host.url="%SONAR_HOST_URL%" ^
	/d:sonar.projectBaseDir="%WORK_DIR%" ^
	/d:sonar.cs.opencover.reportsPaths="TestResults/**/coverage.opencover.xml" ^
	/d:sonar.cs.vstest.reportsPaths="TestResults/TestResults.trx" ^	
	/d:sonar.verbose=true ^
	/v:"5.0" ^
	/d:sonar.token="%SONAR_TOKEN%"

dotnet build --no-incremental
dotnet test "Calculadora.Tests.csproj" --logger:"trx;LogFileName=TestResults.trx" ^
	--collect:"XPlat Code Coverage;Format=opencover" ^
	--results-directory ./TestResults

dotnet sonarscanner end /d:sonar.token="%SONAR_TOKEN%"

But the “Success” doesn´t appear:

Follow a simple project that I used for test

coverage_test_success_not_show.zip (4.9 MB)

Any help is very welcome!!!

Hey there.

This is a known issue that for a long time we said we wouldn’t fix, but now it seems we are. No ETA to share, but thanks for the report. I’d suggest keeping an eye on that ticket.

1 Like

Hello Colin,

Thank you for your response and for clarifying the status of the issue. I’m glad to hear that the team is considering a solution, even though there isn’t a defined ETA yet. I’ll keep an eye on the ticket to stay updated on any developments.

If I can assist in any way, by providing more details or participating in testing, please don’t hesitate to let me know. Thank you again for your attention and support.

2 Likes

Colin,
This bug occurs in paid versions ? Like https://sonarcloud.io, Developer, Enterprise, Data Center ?

Yep. Edition doesn’t make a difference.

FYI, we don’t consider it a bug. We never supported it, and now we will introduce support for it. It’s an improvement.

1 Like