SonarQube analysis fails with 2 NUnitTest-properties set

sonarqube

(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:
sonar.vbnet.nunit.reportsPaths
sonar.cs.nunit.reportsPaths

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?

Antoine


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

Pascal


(Antoine Vigneau) #4

@lol987lol,

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.

Cheers