2
votes

While trying to get a Sonar execution to import a jacoco-it.exec file that was produced on a server with the jacocoagent.jar, I get the following message:

[INFO] [09:54:32.420] Sensor JaCoCoItSensor... [INFO] [09:54:32.462] Analysing /../jenkins/jobs/../jacoco-it.exec [INFO] [09:54:51.385] No information about coverage per test.

I have verified that the jacococ-it.exec file itself does in fact have data in it (385 MB) so it definitely is capturing information, but sonar is not able to reconcile it and I need help fixing it.

I am using:
a multi-module maven project
Sonarqube 4.5.1
Jenkins Sonar Plugin 2.1
Oracle 11g
jacoco 0.7.4
junit 4.11

Sonar creates and uses the UT file jacoco.exec just fine, but I get 0% when it displays the IT results.

[EDIT] - To further clarify
1. we have the jacocoagent.jar monitoring a jvm on an application server
2. a Jenkins job runs a group of selenium tests against the application server in #1
3. the jacoco-it.exec file is copied from the application server to a location that sonar can read. For this I am overriding the sonar it path for the jacoco plugin.
4. I get the above messages that say that sonar can't find the coverage information

The selenium tests are running as integration tests from mvn with:
mvn org.jacoco:jacoco-maven-plugin:prepare-agent-integration clean package install

1
Please add your Maven configuration. I use JaCoCo and I have no problem (but I use SonarQube 5.1). I show my configuration in this topic: Not getting the coverage on new code in sonar dashboard - agabrys
Just to be clear : no information about coverage per test is here to mention that you won't have the information about which test covered which line (see coverage per test section here: docs.sonarqube.org/display/PLUG/…) - benzonico
As stated by @agabrys please describe more precisely your configuration, this sounds like it is related to the fact that the classes you expect to be covered are not in the same module under which the jacoco-it.exec file is analyzed. - benzonico
we have nothing specifically configured in the maven pom for this project for jacoco - TheDevOpsGuru

1 Answers

2
votes

Try forcing an older version (e.g. 0.7.3) of the jacoco-plugin to see if it makes any difference. This has helped for me with a similar problem. I think that there is a known issue in some version(s).