0

I have an issue when I am running sonar for my solution. we have configured the sonar with Gallio and NCover. But the coverage result is not showing in the result.

These are the software versions which we have on our build servers:

Sonar v2.14
Java Runner v1.2
JDK v1.6 : jdk1.6.0_30
Gallio v3.3.458.0
NCover v3.4.16.6924 x86
VS2008
My Sql Server- 5.6

The following are the parameters we are passing to the sonar.

sections from the sonar project properties file

sonar.gallio.mode=
sonar.gallio.installDirectory=C:/Gallio

sonar.gallio.coverage.tool=NCover
sonar.gallio.runner=IsolatedProcess
sonar.NCover.installDirectory=C:/Program Files/NCover
sonar.donet.visualstudio.testProjectPattern=*UnitTest*;Testing*;*test*
sonar.dotnet.test.assemblies=bin/debug/xxx.dll

The Sample Sonar project configuration file

sonar.gallio.mode=
sonar.gallio.installDirectory=C:/Gallio
sonar.gallio.coverage.tool=NCover
sonar.gallio.runner=IsolatedProcess
sonar.donet.visualstudio.testProjectPattern=*UnitTest*;Testing*;*test*;*Test*
sonar.NCover.installDirectory=c:/Program Files/NCover
sonar.dotnet.test.assemblies=bin/Debug/SimpleLibrary.Tests.dll

But I can see a warning message when I am running sonar with respect to NCover regarding the coverage file.

No Gallio coverage report file found for: D:\SareeshTest\SimpleClassLibrary\SimpleClassLibrary.sonar\coverage-report.xml

If I am putting one ‘coverage-report.xml’ which I have created with NCover Explorer separately then the result shows the coverage.

Could you please help me with this or suggest a solution?

oers
  • 18,436
  • 13
  • 66
  • 75
Sareesh
  • 85
  • 1
  • 9
  • Does Gallio execution crash during Sonar analysis? (you can see that in your log) By the way, you should not specify "sonar.gallio.runner=IsolatedProcess" as you're using NCover (see http://docs.codehaus.org/display/SONAR/sonar-csharp-gallio-plugin). And also, you normally do not need to specify "sonar.dotnet.test.assemblies", it will be guessed from the csproj files. – Fabrice - SonarSource Team Apr 10 '12 at 06:19
  • Thanks Fabrice... It worked for me. Now the coverage-report.xml file is created inside the '.sonar' directory. – Sareesh Apr 10 '12 at 10:31
  • Once again thanks for you help. Now i have another issue here. The unit test results are failed.We are using some mock objects for the unit testing. (Rhino.Mock.dll) Could you please suggest or help me in this? – Sareesh Apr 10 '12 at 10:33
  • 1
    OK, as this worked for you, I'll post the solution as an anwser: then, you can vote up for it so that people know that this solution works. For your 2nd question, this is not related to Sonar, you should post another question. – Fabrice - SonarSource Team Apr 10 '12 at 11:41

1 Answers1

2

You should not specify "sonar.gallio.runner=IsolatedProcess" as you're using NCover (see the FAQ about this).

Also, you normally do not need to specify "sonar.dotnet.test.assemblies", it will be guessed from the csproj files.