Some feedbacks about the Gradle runner and Jacoco

155 views
Skip to first unread message

Julien Herr

unread,
May 31, 2016, 11:52:07 AM5/31/16
to SonarQube
Hi,

1/ I found that the display is not consistant between SQ Jacoco plugin and SQ Cobertura plugin :
- "Cobertura report not found at /tmp/testng/target/site/cobertura/coverage.xml" is always diplayed (without debug), but
- "JaCoCoItSensor: JaCoCo IT report not found: /tmp/testng/target/jacoco-it.exec" is only displayed with debug.

2/ I didn'd succeed to run the Gradle runner with the latest Gradle version (2.13). It seems the new embedded Jacoco version changed too much.
A workarround exists and is provided in the gradle release notes: https://docs.gradle.org/current/release-notes#jacoco-version-upgrade-to-0.7.6
This issue is funny when you see who upgraded Jacoco into Gradle (and broke the sonarqube plugin :p)

I don't exclude that I made mistake in the build files and everything is available on https://github.com/cbeust/testng

Regards,
Julien

Julien HENRY

unread,
Jun 1, 2016, 3:42:04 AM6/1/16
to SonarQube, Fabrice Bellingard
Hi Julien,

For Cobertura let say this plugin is not our priority. We are focusing on JaCoCo.

I just made a test on one of our Gradle project and using Gradle 2.13 + JaCoCo 0.7.6 + SonarQube plugin 2.0.1 works fine out of the box. Do you have any error or simply you don't see coverage in SonarQube?

Also looking at your travis.sh it seems you are mixing two features of SonarQube:
  - regular/published analysis => should be executed on your master branch and will publish result on SonarQube server
  - preview/pull request analysis => should be executed on pull request with parameter -Dsonar.analysis.mode=issue

In your case it seems you want to analyze your pull requests, so you need to add -Dsonar.analysis.mode=issue parameter.

++

Julien

Julien Herr

unread,
Jun 1, 2016, 6:53:02 AM6/1/16
to SonarQube, fabrice.b...@sonarsource.com


Le mercredi 1 juin 2016 09:42:04 UTC+2, Julien HENRY a écrit :
Hi Julien,

For Cobertura let say this plugin is not our priority. We are focusing on JaCoCo.

Yep, agree. I warn you about it because Fabrice asked me to do it :)
 

I just made a test on one of our Gradle project and using Gradle 2.13 + JaCoCo 0.7.6 + SonarQube plugin 2.0.1 works fine out of the box. Do you have any error or simply you don't see coverage in SonarQube?

I had no coverage because sonarqube plugin didn't find the jacoco file. But I've just tried it again on another computer and it is working well as expected... So, forget it for the moment and I will try on my previous computer later.
 

Also looking at your travis.sh it seems you are mixing two features of SonarQube:
  - regular/published analysis => should be executed on your master branch and will publish result on SonarQube server
  - preview/pull request analysis => should be executed on pull request with parameter -Dsonar.analysis.mode=issue

In your case it seems you want to analyze your pull requests, so you need to add -Dsonar.analysis.mode=issue parameter.

Yes, PR anaylse is something I tried to do months ago without success, and I will retry it again once the regular analysis is working on travis.


Thank for the help :)

thor...@gmail.com

unread,
Apr 4, 2018, 11:48:04 AM4/4/18
to SonarQube
Is there a way to make the sonarqube plugin ignore Cobertura entirely?
I'm not using Cobertura explicitly, but if the sonarqube plugin detects its presence it might be that one or more of my other plugins are dragging it along, however I don't really need to see "Cobertura report not found at" when I'm not interested in Cobertura reports in the first place.

Sorry for hijacking and resurrecting an old post, but this was top hit on Google when I was looking for details about this warning.
Reply all
Reply to author
Forward
0 new messages