Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 365
faenschi Avatar asked Dec 15 '25 19:12

faenschi


1 Answers

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,

like image 79
Kraal Avatar answered Dec 18 '25 02:12

Kraal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!