Unit Tests 1 but List is empty

247 views
Skip to first unread message

Tornai András

unread,
Jun 22, 2016, 7:50:12 PM6/22/16
to sona...@googlegroups.com
Hi everybody,

I cloned https://github.com/SonarSource/sonar-examples.git then opened a command prompt under SonarSource/sonar-examples/tree/master/projects/languages/csharp and run the following commands (based on http://docs.sonarqube.org/pages/viewpage.action?pageId=6389772):

MSBuild.SonarQube.Runner.exe begin /k:"org.sonarqube:csharp-simple-sq-scanner-msbuild" /n:"C# :: Simple Project :: SonarQube Scanner for MSBuild" /v:"1.0" /d:sonar.cs.xunit.reportsPaths="%CD%\XUnitResults.xml"
MSBuild.exe /t:Rebuild
packages\xunit.runner.console.2.1.0\tools\xunit.console.exe XUnitProject1\bin\Debug\XUnitProject1.dll -xml %CD%\XUnitResults.xml
MSBuild.SonarQube.Runner.exe end

Under metric/tests/list I get "Unit Tests 1" and that is OK but beneath it the list is empty. (see attachment) Why?

The relevant part from console:
INFO: Sensor org.sonar.plugins.csharp.CSharpUnitTestResultsProvider$CSharpUnitTestResultsImportSensor
INFO: Parsing the XUnit Test Results file C:\workspace\SonarSource-sonar-examples-92828b2\projects\languages\csharp\XUnitResults.xml
INFO: Sensor org.sonar.plugins.csharp.CSharpUnitTestResultsProvider$CSharpUnitTestResultsImportSensor (done) | time=15ms


SonarQube 5.6 w embedded h2 (extra plugins: C# 5.3, StyleCop 1.1) 

Regards,
András
1UnitTestButEmptyList.PNG

gsmith...@gmail.com

unread,
Jun 23, 2016, 7:54:09 AM6/23/16
to SonarQube
Hi András,

I don't have an answer for you but I can tell you that I have the same problem using SonarQube 5.6, C# plugin and NUnit with all of our C# projects. I wonder if the problem lies with the process that sends the results of the unit test analysis back to the SonarQube server.

Guy


Tornai András

unread,
Jul 31, 2016, 11:13:49 AM7/31/16
to SonarQube, gsmith...@gmail.com
Hello Guy and everyone,

I spent several hours on this topic:
Sonarqube docs says: "Drilldown on Test Execution Results is not supported Tests execution results will be displayed on project level dashboards."
There is an open ticket about this problem: https://jira.sonarsource.com/browse/SONARNTEST-17
and this another one is also worth to look: https://jira.sonarsource.com/browse/SONARMSBRU-233

So now I think it is a limitation of the C# plugin and not a bug or configuration issue.

Regards,
András
Reply all
Reply to author
Forward
0 new messages