SonarQube analysis fails with 2 NUnitTest-properties set


(Pascal) #1

Hello together,

I tried to add 2 properties for NUnitTests to decorate our Code-Coverage in SonarQube.
For us it is important to be able to set the 2 properties (for C# and VB.NET)
Our SonarQube-Version: 7.4.0. (Dev-Edition)
The proerties are the following:

The Error:

(Antoine Vigneau) #2

Hello @lol987lol

If you set both sonar.cs.nunit.reportPaths and sonar.vbnet.nunit.reportPaths to the same value, the scanner will load the measure for both languages at each execution of the sensor, i.e one for VB.NET and one for C#, and the above error happens.

To fix this you have 2 solutions:

  • you can keep one file for all tests results (as you probably have) and use only one of the two parameters
  • split tests results in two files (one for C# tests, one for VB.NET tests) and use reportPaths parameters accordingly

Does it make sense to you?


(Pascal) #3

Hello @Antoine

I totally understand your argument.
But if we do it like you described in your first solution we only have the tests of one language implemented. (either C# or VB).
The second solution is a huge effort for us and therefore no solution in our case.


(Antoine Vigneau) #4


I might sound misleading but using one of these 2 arguments will actually report the measure for both languages. The scanner behavior about it is .NET based let’s say, not per language.

BTW it’s something we are thinking to change, have one single sonar.dotnet.nunit.reportsPaths parameter instead of the per-language ones.