Gallio not working with sonar-runner - jenkins

I'm trying to get sonar-runner to run Gallio and OpenCover on my .net application.
I've set up the following:
Sonarqube v4.3.2
Gallio v3.4.14
NUnit v2.6.3
OpenCover v4.5
Sonar-runner v2.4
Here is what I have in my sonar-project.properties file (the things conserning Gallio)
\#Gallio
sonar.gallio.mode=
sonar.gallio.coverage.tool=OpenCover
sonar.donet.visualstudio.testProjectPattern=*Test*
sonar.opencover.installDirectory=C:\\Program Files (x86)\\OpenCover\\
sonar.dotnet.test.assemblies=**\\bin\\Debug\\*.Tests.dll
sonar.gallio.runner=Local
I have tried all sorts of variations of this config file but the weird thing is that when I run sonar-runner, even with parameters -X or -e, there is absolutely no mention of Gallio or OpenCover in the output. It's like the sonar runner is just skipping the Gallio section completely!
Does anyone here have a clue of what might be going on ?

Latest versions of the C# Plugin do not support the automatic execution of Gallio (see this documentation).
Starting with C# 3.0, only the reuse of reports is supported to get test and coverage information for .NET projects. Please read the documentation page of the C# plugin to know how to do that.

Related

How to get modules' coverage via sonar runner in jenkins

What we have:
jenkins 1.6 + SonarQube 4.5.6 + sonnar-runner 2.4 + maven 3.0.5
Issue Description:
We use 'Invoke Standalone SonarQube Analysis' in jobs' configuration, and it works fine except that it cannot get test coverage while the analysis just try to parsing the <base_dir>/target/site/cobertura/coverage.xml. But we have coverage.xml in the modules directory instead, just like <base_dir>/module1/target/site/cobertura/coverage.xml
I have tried to set sonar modules, but nothing happened, we still cannot get the coverage data.
Previously, we used sonar-maven-plugin for the analysis, but after we upgrade to SonarQube 4.5.6, we met some issues, like api incompatibility, measure twice, and so we changed to use sonar-runner. sonar-maven-plugin works fine to parsing the modules' coverage.xml.
How can we retrieve the coverage data in the modules' directory.
Or how can we merge the modules coverage.xml into one coverage.xml in the root directory for sonar-runner to parse.
Any comment? Thanks very much!

Jenkins NUnit plugin lacks useful info

We have implemented some integration tests using NUnit under Jenkins and have used the NUnit plugin to produce a report output. But the output is devoid of any useful info, especially error messages and console output. Are we doing something wrong?
The test uses the following, with names changed to protect the innocent.
"C:\Program Files (x86)\NUnit 2.6.4\bin\nunit-console.exe"
"D:\public\data\sweb\eNterpriseTesting\eNterpriseTesting.Library\bin\Debug\eNterpriseTesting.Library.dll"
/run:eNterpriseTesting.Library.Tests.OrderTest
/xml:D:\public\data\sweb\eNterpriseTesting\eNterpriseTesting.Library\bin\Debug\TestResult.xml
Any Ideas other than using reportUnit?
Thanks

Sonar 5.2 & Cobertura Plugin doesn't work

We upgraded to Sonar 5.2. But now, the task to process the sonar report fails:
2015.12.21 16:08:20 ERROR [o.s.s.c.t.CeWorkerRunnableImpl] Failed to execute task AVHFFR9SqYJURQAYr8yb
java.lang.IllegalArgumentException: There's no changeset on line 59
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:125) ~[guava-17.0.jar:na]
at org.sonar.server.computation.scm.ScmInfoImpl.getChangesetForLine(ScmInfoImpl.java:64) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.scm.DbScmInfo.getChangesetForLine(DbScmInfo.java:69) ~[sonar-server-5.2.jar:na]
at org.sonar.server.computation.step.NewCoverageMeasuresStep$NewCoverageCounter.initialize(NewCoverageMeasuresStep.java:391) ~[so
If I uninstall the Cobertura Plugin which has version 1.6.3, then the report process works fine. But that's no solution for me because I need these reports. Did anybody succeed to solve this error in another way?
regards
Two thoughts:
1) Your issue seems related to this discussion on SonarQube's group. Check if you have such line number="0" in your cobertura.xml file. Unfortunately the fix is planned for SonarQube 5.4 (i.e. 04/Mar/16.)
2) Depending on your exact needs related to Cobertura reports generation and if you're using Maven, you can try to use QualInsight Maven Cobertura plugin to generate your Cobertura reports. This plugin provides the qualinsight-mojo-cobertura-core mojo, an alternative to the cobertura-maven-plugin mojo you're probably using if your build is Maven based. QualInsight Maven Cobertura plugin generates separate reports for UTs, ITs, and combined Overall Test coverage. It generates standard cobertura.xml reports, but also is able to convert them to SonarQube Generic Test Coverage plugin format.
Maybe generated reports by qualinsight-mojo-cobertura-core won't contain data causing issues + maybe using SonarQube's Generic Coverage plugin instead of SonarQube's Cobertura plugin won't cause the exception you get (it was released 9 days ago and tested towards SQ 5.2, while the Cobertura plugin was last released in September 2014)
If want to give it a try and need help / have questions with this solution, just ask (I'm the developer QualInsight Maven Cobertura plugin.)
Regards,

ReSharper error when executing SonarQube analysis from TFS 2013 build

I have been setting up SonarQube analysis from a TFS 2013 build using the instructions made by Microsoft ALM Rangers:
https://vsarguidance.codeplex.com/downloads/get/1452516
It all Works fine, until I add ReSharper analysis, then i get an error;
09:51:49: ERROR: Error during Sonar runner execution
09:51:49: ERROR: Unable to execute Sonar
09:51:49: ERROR: Caused by: The property "sonar.resharper.cs.reportPath" must be set.
I have added a sonar-project.properties file to TFS in the same directory as my solution file.
The file looks like:
sonar.resharper.projectName=CommonComponents
sonar.resharper.cs.reportPath=resharperresults.xml
Im using SonarQube 5.1 and the R# 2.0 plugin
Running analysis from Jenkins Works fine.
I really hope you can help me out of this. Im pretty sure its something stupid that I just can't turn my eyes around to see.
The support of the R# by the MSBuild Runner is only going to become available in the version 1.0 of the MSBuild Runner & 2.0 of the R#. See the following tickets:
http://jira.sonarsource.com/browse/SONARMSBRU-16
http://jira.sonarsource.com/browse/SONARRSHPR-15

Using Gallio with OpenCover coverage-report file contais result but Sonar reports 0%

I have the problem that the code coverage for some reason aren't presented in Sonar.
The result of the unit tests is performed and showed correctly but not the result of the code coverage. The project is build by Jenkins. I have registered the opencover.profiler.dll file as suggested in some threads but still I get no result. Neither I get any error messages in Jenkins when performing the build.
I would be most grateful for any tips on what to do.
Best regards Dan
I think this happens because your Jenkins service is running as "Local System account", but Sonar is running OpenCover with the -register:user switch under the hoods. You should be able to bypass this either by running the Jenkins service as a regular user account, or patch the Sonar-runner to omit the -register:user switch.
It turned out however that the PDB-files caused the problems. They were included in the repository and were for some reason not recreated by the build in Jenkins. The PDB-files therefor contained the wrong path to the actual code files.
Thanks for the help!
Check for version conflicts between OpenCover and the Gallio plugin.
I found that the later versions of OPenCover (starting with Version 4.0.1229) inserted a new tag in the coverage-report.xml file - which the Gallio plugin could not understand. When I rolled back to an older version of OpenCover (4.0.804) the coverage worked again.
You can find more details on http://sonar.15.n6.nabble.com/coverage-report-xml-is-generated-but-sonar-says-coverage-is-0-td5008850.html
It looks like the Gallio plug-in has been updated, but I haven't pursued that yet (wanted to first confirm that this was the cause of the problem).

Resources