Quantcast

Code coverage using Sonar, Jenkins and Ant

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Code coverage using Sonar, Jenkins and Ant

Gilles Scouvart
Hello all,

I'm new to Sonar, and I'm setting it up for the continuous integration of my Java project, which is built using Jenkins with an Ant configuration.
I'm using the Jenkins Sonar plugin, and running Sonar in standalone mode. It already gives a lot of useful metrics, but I would like to see the unit test reports and most importantly, the coverage report in Sonar.
Therefore, I have
  • added a JaCoCo task in my Ant build
  • activated Sonar reuseReport: sonar.dynamicAnalysis=reuseReports
  • specified explicitly the JaCoCo plugin for code coverage: sonar.core.codeCoveragePlugin=jacoco
  • specified the path to the JaCoCo exec report file: sonar.jacoco.reportPath=coverage/report/jacoco.exec

I have verified that the correct output is written in the workspace. However, the code coverage information does not show up in the Sonar report.
Could someone tell me what I'm doing wrong here?

Many thanks for your help,

Gilles Scouvart.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code coverage using Sonar, Jenkins and Ant

David Racodon-2
Hi Gilles,

Everything seems correct to me.
Have you checked whether your JaCoCo report would be empty or not?

Maybe you can compare with the example. There's maybe a slight difference: http://docs.codehaus.org/display/SONAR/Sonar+Project+Examples


Regards,

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:11, Gilles Scouvart <[hidden email]> wrote:
Hello all,

I'm new to Sonar, and I'm setting it up for the continuous integration of my Java project, which is built using Jenkins with an Ant configuration.
I'm using the Jenkins Sonar plugin, and running Sonar in standalone mode. It already gives a lot of useful metrics, but I would like to see the unit test reports and most importantly, the coverage report in Sonar.
Therefore, I have
  • added a JaCoCo task in my Ant build
  • activated Sonar reuseReport: sonar.dynamicAnalysis=reuseReports
  • specified explicitly the JaCoCo plugin for code coverage: sonar.core.codeCoveragePlugin=jacoco
  • specified the path to the JaCoCo exec report file: sonar.jacoco.reportPath=coverage/report/jacoco.exec

I have verified that the correct output is written in the workspace. However, the code coverage information does not show up in the Sonar report.
Could someone tell me what I'm doing wrong here?

Many thanks for your help,

Gilles Scouvart.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code coverage using Sonar, Jenkins and Ant

Gilles Scouvart
Hi David,

Thanks for your swift response.
The report is 415KB large, so I suppose it is not empty. Meanwhile, I also output the HTML report, which seems to be full with relevant data.
I have copied the configuration recommended, and now I get the unit test report, but still not the coverage.
In the console output, I see no reference to JaCoCo whatsoever. Is this normal? Shouldn't it be complaining that it doesn't find the report?
Here is the log, if it is of any help:

---------
[workspace] $ "C:\Program Files\Java\jdk1.6.0_29/bin/java" -cp F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-runner2077663624405859409.jar;F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-batch-bootstrapper978396760416267637.jar org.sonar.runner.Main -Dsonar.host.url=http://melian:8181/sonar -Dsources=src/main/java/ -Dsonar.dynamicAnalysis=reuseReports -Dtests=src/test/java/ -Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.surefire.reportsPath=test-reports -Dsonar.java.target=1.6 -Dsonar.jacoco.reportPath=coverage/report/jacoco.exec -Dsonar.projectVersion=1.0 -Dsonar.projectKey=pcr:unit_test -Dlibraries=./lib/cplex.jar,./lib/jdom.jar,./lib/log4j-1.3alpha-6.jar -Dbinaries=classes -Dsonar.java.source=1.6 -Dsonar.projectName="PCR"
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
OS name: "Windows 2003", version: "5.2", arch: "amd64"
Server: http://melian:8181/sonar
Work directory: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.sonar
[INFO]  Database dialect class org.sonar.jpa.dialect.Derby
[INFO]  Initializing Hibernate
[INFO]  -------------  Analyzing PCR
[INFO]  Selected quality profile : [name=Sonar way with Findbugs,language=java]
[INFO]  Configure maven plugins...
[INFO]  Compare to previous analysis (2012-06-22)
[INFO]  Compare over 5 days (2012-06-17, analysis of 2012-06-18 17:45:25.154)
[INFO]  Compare over 30 days (2012-05-23, analysis of 2012-05-25 11:39:15.15)
[INFO]  Sensor JavaSourceImporter...
[INFO]  Sensor JavaSourceImporter done: 3000 ms
[INFO]  Sensor SquidSensor...
[INFO]  Java AST scan...
[INFO]  Java AST scan done: 4515 ms
[INFO]  Java bytecode scan...
[INFO]  Java bytecode scan done: 2468 ms
[INFO]  Java Squid scan...
[INFO]  Java Squid scan done: 15 ms
[INFO]  Squid extraction...
[INFO]  Package design analysis...
[INFO]  Package design analysis done: 2328 ms
[INFO]  Squid extraction done: 7281 ms
[INFO]  Sensor SquidSensor done: 14702 ms
[INFO]  Sensor FindbugsSensor...
[INFO]  Execute Findbugs 1.3.9...
[INFO]  Found findbugs plugin: file:/C:/WINDOWS/TEMP/sonar-batch54720348958202792076553354435695/plugins/findbugs/META-INF/lib/findbugs-1.3.9.jar
[INFO]  Loaded plugin edu.umd.cs.findbugs.plugins.core
[INFO]  Findbugs output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\findbugs-result.xml
[INFO]  Execute Findbugs 1.3.9 done: 59655 ms
[INFO]  Sensor FindbugsSensor done: 60390 ms
[INFO]  Sensor SurefireSensor...
[INFO]  parsing F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\test-reports
[INFO]  Sensor SurefireSensor done: 234 ms
[INFO]  Sensor CpdSensor...
[INFO]  Sensor CpdSensor done: 703 ms
[INFO]  Sensor CheckstyleSensor...
[INFO]  Execute Checkstyle 5.1...
[INFO]  Checkstyle configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\checkstyle.xml
[INFO]  Execute Checkstyle 5.1 done: 4484 ms
[INFO]  Sensor CheckstyleSensor done: 4500 ms
[INFO]  Sensor PmdSensor...
[INFO]  Execute PMD 4.2.5...
[INFO]  Java version: 1.6
[INFO]  PMD configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd.xml
[INFO]  PMD output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd-result.xml
[INFO]  Execute PMD 4.2.5 done: 19859 ms
[INFO]  Sensor PmdSensor done: 20484 ms
[INFO]  Sensor ProfileSensor...
[INFO]  Sensor ProfileSensor done: 1125 ms
[INFO]  Sensor ProfileEventsSensor...
[INFO]  Sensor ProfileEventsSensor done: 47 ms
[INFO]  Sensor VersionEventsSensor...
[INFO]  Sensor VersionEventsSensor done: 31 ms
[INFO]  Execute decorators...
[INFO]  ANALYSIS SUCCESSFUL, you can browse http://melian:8181/sonar
[INFO]  Executing post-job class org.sonar.plugins.dbcleaner.runner.PurgeRunner
[INFO]  Database optimization...
***Ommitted for brevity****
[INFO]  There are no snapshots to purge
[INFO]  Purge org.sonar.plugins.dbcleaner.period.PeriodPurge done: 969 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies done: 1734 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews done: 32 ms
[INFO]  Database optimization done: 28890 ms
Total time: 3:04.434s
Final Memory: 20M/803M
Recording test results
[DEBUG] Skipping watched dependency update; build not configured with trigger: pcr-algo-dev_PCR #45
Finished: SUCCESS
---------

Thanks again,

Gilles.

On Fri, Jun 22, 2012 at 6:21 PM, David Racodon <[hidden email]> wrote:
Hi Gilles,

Everything seems correct to me.
Have you checked whether your JaCoCo report would be empty or not?

Maybe you can compare with the example. There's maybe a slight difference: http://docs.codehaus.org/display/SONAR/Sonar+Project+Examples


Regards,

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:11, Gilles Scouvart <[hidden email]> wrote:
Hello all,

I'm new to Sonar, and I'm setting it up for the continuous integration of my Java project, which is built using Jenkins with an Ant configuration.
I'm using the Jenkins Sonar plugin, and running Sonar in standalone mode. It already gives a lot of useful metrics, but I would like to see the unit test reports and most importantly, the coverage report in Sonar.
Therefore, I have
  • added a JaCoCo task in my Ant build
  • activated Sonar reuseReport: sonar.dynamicAnalysis=reuseReports
  • specified explicitly the JaCoCo plugin for code coverage: sonar.core.codeCoveragePlugin=jacoco
  • specified the path to the JaCoCo exec report file: sonar.jacoco.reportPath=coverage/report/jacoco.exec

I have verified that the correct output is written in the workspace. However, the code coverage information does not show up in the Sonar report.
Could someone tell me what I'm doing wrong here?

Many thanks for your help,

Gilles Scouvart.


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code coverage using Sonar, Jenkins and Ant

Gilles Scouvart
Hi David,

I just realized that I have not changed the default JaCoCo project name in my "structure" tag in my ant jacoco:report task.
Should I set it to something matching the sonar analysis key?

Kind regards,

Gilles.


On Fri, Jun 22, 2012 at 6:44 PM, Gilles Scouvart <[hidden email]> wrote:
Hi David,

Thanks for your swift response.
The report is 415KB large, so I suppose it is not empty. Meanwhile, I also output the HTML report, which seems to be full with relevant data.
I have copied the configuration recommended, and now I get the unit test report, but still not the coverage.
In the console output, I see no reference to JaCoCo whatsoever. Is this normal? Shouldn't it be complaining that it doesn't find the report?
Here is the log, if it is of any help:

---------
[workspace] $ "C:\Program Files\Java\jdk1.6.0_29/bin/java" -cp F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-runner2077663624405859409.jar;F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-batch-bootstrapper978396760416267637.jar org.sonar.runner.Main -Dsonar.host.url=http://melian:8181/sonar -Dsources=src/main/java/ -Dsonar.dynamicAnalysis=reuseReports -Dtests=src/test/java/ -Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.surefire.reportsPath=test-reports -Dsonar.java.target=1.6 -Dsonar.jacoco.reportPath=coverage/report/jacoco.exec -Dsonar.projectVersion=1.0 -Dsonar.projectKey=pcr:unit_test -Dlibraries=./lib/cplex.jar,./lib/jdom.jar,./lib/log4j-1.3alpha-6.jar -Dbinaries=classes -Dsonar.java.source=1.6 -Dsonar.projectName="PCR"
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
OS name: "Windows 2003", version: "5.2", arch: "amd64"
Server: http://melian:8181/sonar
Work directory: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.sonar
[INFO]  Database dialect class org.sonar.jpa.dialect.Derby
[INFO]  Initializing Hibernate
[INFO]  -------------  Analyzing PCR
[INFO]  Selected quality profile : [name=Sonar way with Findbugs,language=java]
[INFO]  Configure maven plugins...
[INFO]  Compare to previous analysis (2012-06-22)
[INFO]  Compare over 5 days (2012-06-17, analysis of 2012-06-18 17:45:25.154)
[INFO]  Compare over 30 days (2012-05-23, analysis of 2012-05-25 11:39:15.15)
[INFO]  Sensor JavaSourceImporter...
[INFO]  Sensor JavaSourceImporter done: 3000 ms
[INFO]  Sensor SquidSensor...
[INFO]  Java AST scan...
[INFO]  Java AST scan done: 4515 ms
[INFO]  Java bytecode scan...
[INFO]  Java bytecode scan done: 2468 ms
[INFO]  Java Squid scan...
[INFO]  Java Squid scan done: 15 ms
[INFO]  Squid extraction...
[INFO]  Package design analysis...
[INFO]  Package design analysis done: 2328 ms
[INFO]  Squid extraction done: 7281 ms
[INFO]  Sensor SquidSensor done: 14702 ms
[INFO]  Sensor FindbugsSensor...
[INFO]  Execute Findbugs 1.3.9...
[INFO]  Found findbugs plugin: file:/C:/WINDOWS/TEMP/sonar-batch54720348958202792076553354435695/plugins/findbugs/META-INF/lib/findbugs-1.3.9.jar
[INFO]  Loaded plugin edu.umd.cs.findbugs.plugins.core
[INFO]  Findbugs output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\findbugs-result.xml
[INFO]  Execute Findbugs 1.3.9 done: 59655 ms
[INFO]  Sensor FindbugsSensor done: 60390 ms
[INFO]  Sensor SurefireSensor...
[INFO]  parsing F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\test-reports
[INFO]  Sensor SurefireSensor done: 234 ms
[INFO]  Sensor CpdSensor...
[INFO]  Sensor CpdSensor done: 703 ms
[INFO]  Sensor CheckstyleSensor...
[INFO]  Execute Checkstyle 5.1...
[INFO]  Checkstyle configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\checkstyle.xml
[INFO]  Execute Checkstyle 5.1 done: 4484 ms
[INFO]  Sensor CheckstyleSensor done: 4500 ms
[INFO]  Sensor PmdSensor...
[INFO]  Execute PMD 4.2.5...
[INFO]  Java version: 1.6
[INFO]  PMD configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd.xml
[INFO]  PMD output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd-result.xml
[INFO]  Execute PMD 4.2.5 done: 19859 ms
[INFO]  Sensor PmdSensor done: 20484 ms
[INFO]  Sensor ProfileSensor...
[INFO]  Sensor ProfileSensor done: 1125 ms
[INFO]  Sensor ProfileEventsSensor...
[INFO]  Sensor ProfileEventsSensor done: 47 ms
[INFO]  Sensor VersionEventsSensor...
[INFO]  Sensor VersionEventsSensor done: 31 ms
[INFO]  Execute decorators...
[INFO]  ANALYSIS SUCCESSFUL, you can browse http://melian:8181/sonar
[INFO]  Executing post-job class org.sonar.plugins.dbcleaner.runner.PurgeRunner
[INFO]  Database optimization...
***Ommitted for brevity****
[INFO]  There are no snapshots to purge
[INFO]  Purge org.sonar.plugins.dbcleaner.period.PeriodPurge done: 969 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies done: 1734 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews done: 32 ms
[INFO]  Database optimization done: 28890 ms
Total time: 3:04.434s
Final Memory: 20M/803M
Recording test results
[DEBUG] Skipping watched dependency update; build not configured with trigger: pcr-algo-dev_PCR #45
Finished: SUCCESS
---------

Thanks again,

Gilles.


On Fri, Jun 22, 2012 at 6:21 PM, David Racodon <[hidden email]> wrote:
Hi Gilles,

Everything seems correct to me.
Have you checked whether your JaCoCo report would be empty or not?

Maybe you can compare with the example. There's maybe a slight difference: http://docs.codehaus.org/display/SONAR/Sonar+Project+Examples


Regards,

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:11, Gilles Scouvart <[hidden email]> wrote:
Hello all,

I'm new to Sonar, and I'm setting it up for the continuous integration of my Java project, which is built using Jenkins with an Ant configuration.
I'm using the Jenkins Sonar plugin, and running Sonar in standalone mode. It already gives a lot of useful metrics, but I would like to see the unit test reports and most importantly, the coverage report in Sonar.
Therefore, I have
  • added a JaCoCo task in my Ant build
  • activated Sonar reuseReport: sonar.dynamicAnalysis=reuseReports
  • specified explicitly the JaCoCo plugin for code coverage: sonar.core.codeCoveragePlugin=jacoco
  • specified the path to the JaCoCo exec report file: sonar.jacoco.reportPath=coverage/report/jacoco.exec

I have verified that the correct output is written in the workspace. However, the code coverage information does not show up in the Sonar report.
Could someone tell me what I'm doing wrong here?

Many thanks for your help,

Gilles Scouvart.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code coverage using Sonar, Jenkins and Ant

David Racodon-2
In reply to this post by Gilles Scouvart
Hi Gilles,

From what I can see, you seem to use the Sonar Runner to launch your Sonar analysis:
...
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
...

I thought you had an Ant project...

Could you start first to run the examples below?:
and once it's working, add your project specificities.

Thank you

Regards,


David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:44, Gilles Scouvart <[hidden email]> wrote:
Hi David,

Thanks for your swift response.
The report is 415KB large, so I suppose it is not empty. Meanwhile, I also output the HTML report, which seems to be full with relevant data.
I have copied the configuration recommended, and now I get the unit test report, but still not the coverage.
In the console output, I see no reference to JaCoCo whatsoever. Is this normal? Shouldn't it be complaining that it doesn't find the report?
Here is the log, if it is of any help:

---------
[workspace] $ "C:\Program Files\Java\jdk1.6.0_29/bin/java" -cp F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-runner2077663624405859409.jar;F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-batch-bootstrapper978396760416267637.jar org.sonar.runner.Main -Dsonar.host.url=http://melian:8181/sonar -Dsources=src/main/java/ -Dsonar.dynamicAnalysis=reuseReports -Dtests=src/test/java/ -Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.surefire.reportsPath=test-reports -Dsonar.java.target=1.6 -Dsonar.jacoco.reportPath=coverage/report/jacoco.exec -Dsonar.projectVersion=1.0 -Dsonar.projectKey=pcr:unit_test -Dlibraries=./lib/cplex.jar,./lib/jdom.jar,./lib/log4j-1.3alpha-6.jar -Dbinaries=classes -Dsonar.java.source=1.6 -Dsonar.projectName="PCR"
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
OS name: "Windows 2003", version: "5.2", arch: "amd64"
Server: http://melian:8181/sonar
Work directory: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.sonar
[INFO]  Database dialect class org.sonar.jpa.dialect.Derby
[INFO]  Initializing Hibernate
[INFO]  -------------  Analyzing PCR
[INFO]  Selected quality profile : [name=Sonar way with Findbugs,language=java]
[INFO]  Configure maven plugins...
[INFO]  Compare to previous analysis (2012-06-22)
[INFO]  Compare over 5 days (2012-06-17, analysis of 2012-06-18 17:45:25.154)
[INFO]  Compare over 30 days (2012-05-23, analysis of 2012-05-25 11:39:15.15)
[INFO]  Sensor JavaSourceImporter...
[INFO]  Sensor JavaSourceImporter done: 3000 ms
[INFO]  Sensor SquidSensor...
[INFO]  Java AST scan...
[INFO]  Java AST scan done: 4515 ms
[INFO]  Java bytecode scan...
[INFO]  Java bytecode scan done: 2468 ms
[INFO]  Java Squid scan...
[INFO]  Java Squid scan done: 15 ms
[INFO]  Squid extraction...
[INFO]  Package design analysis...
[INFO]  Package design analysis done: 2328 ms
[INFO]  Squid extraction done: 7281 ms
[INFO]  Sensor SquidSensor done: 14702 ms
[INFO]  Sensor FindbugsSensor...
[INFO]  Execute Findbugs 1.3.9...
[INFO]  Found findbugs plugin: file:/C:/WINDOWS/TEMP/sonar-batch54720348958202792076553354435695/plugins/findbugs/META-INF/lib/findbugs-1.3.9.jar
[INFO]  Loaded plugin edu.umd.cs.findbugs.plugins.core
[INFO]  Findbugs output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\findbugs-result.xml
[INFO]  Execute Findbugs 1.3.9 done: 59655 ms
[INFO]  Sensor FindbugsSensor done: 60390 ms
[INFO]  Sensor SurefireSensor...
[INFO]  parsing F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\test-reports
[INFO]  Sensor SurefireSensor done: 234 ms
[INFO]  Sensor CpdSensor...
[INFO]  Sensor CpdSensor done: 703 ms
[INFO]  Sensor CheckstyleSensor...
[INFO]  Execute Checkstyle 5.1...
[INFO]  Checkstyle configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\checkstyle.xml
[INFO]  Execute Checkstyle 5.1 done: 4484 ms
[INFO]  Sensor CheckstyleSensor done: 4500 ms
[INFO]  Sensor PmdSensor...
[INFO]  Execute PMD 4.2.5...
[INFO]  Java version: 1.6
[INFO]  PMD configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd.xml
[INFO]  PMD output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd-result.xml
[INFO]  Execute PMD 4.2.5 done: 19859 ms
[INFO]  Sensor PmdSensor done: 20484 ms
[INFO]  Sensor ProfileSensor...
[INFO]  Sensor ProfileSensor done: 1125 ms
[INFO]  Sensor ProfileEventsSensor...
[INFO]  Sensor ProfileEventsSensor done: 47 ms
[INFO]  Sensor VersionEventsSensor...
[INFO]  Sensor VersionEventsSensor done: 31 ms
[INFO]  Execute decorators...
[INFO]  ANALYSIS SUCCESSFUL, you can browse http://melian:8181/sonar
[INFO]  Executing post-job class org.sonar.plugins.dbcleaner.runner.PurgeRunner
[INFO]  Database optimization...
***Ommitted for brevity****
[INFO]  There are no snapshots to purge
[INFO]  Purge org.sonar.plugins.dbcleaner.period.PeriodPurge done: 969 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies done: 1734 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews done: 32 ms
[INFO]  Database optimization done: 28890 ms
Total time: 3:04.434s
Final Memory: 20M/803M
Recording test results
[DEBUG] Skipping watched dependency update; build not configured with trigger: pcr-algo-dev_PCR #45
Finished: SUCCESS
---------

Thanks again,

Gilles.

On Fri, Jun 22, 2012 at 6:21 PM, David Racodon <[hidden email]> wrote:
Hi Gilles,

Everything seems correct to me.
Have you checked whether your JaCoCo report would be empty or not?

Maybe you can compare with the example. There's maybe a slight difference: http://docs.codehaus.org/display/SONAR/Sonar+Project+Examples


Regards,

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:11, Gilles Scouvart <[hidden email]> wrote:
Hello all,

I'm new to Sonar, and I'm setting it up for the continuous integration of my Java project, which is built using Jenkins with an Ant configuration.
I'm using the Jenkins Sonar plugin, and running Sonar in standalone mode. It already gives a lot of useful metrics, but I would like to see the unit test reports and most importantly, the coverage report in Sonar.
Therefore, I have
  • added a JaCoCo task in my Ant build
  • activated Sonar reuseReport: sonar.dynamicAnalysis=reuseReports
  • specified explicitly the JaCoCo plugin for code coverage: sonar.core.codeCoveragePlugin=jacoco
  • specified the path to the JaCoCo exec report file: sonar.jacoco.reportPath=coverage/report/jacoco.exec

I have verified that the correct output is written in the workspace. However, the code coverage information does not show up in the Sonar report.
Could someone tell me what I'm doing wrong here?

Many thanks for your help,

Gilles Scouvart.



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code coverage using Sonar, Jenkins and Ant

Freddy Mallet
Hi Gilles,

Which Sonar version are you using because looks like you're not using the last one and the version you're using doesn't seem to embed Jacoco ? 

Thanks
Freddy
-----
Sonar for Continuous Inspection



On Fri, Jun 22, 2012 at 7:19 PM, David Racodon <[hidden email]> wrote:
Hi Gilles,

From what I can see, you seem to use the Sonar Runner to launch your Sonar analysis:
...
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
...

I thought you had an Ant project...

Could you start first to run the examples below?:
and once it's working, add your project specificities.

Thank you

Regards,


David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:44, Gilles Scouvart <[hidden email]> wrote:
Hi David,

Thanks for your swift response.
The report is 415KB large, so I suppose it is not empty. Meanwhile, I also output the HTML report, which seems to be full with relevant data.
I have copied the configuration recommended, and now I get the unit test report, but still not the coverage.
In the console output, I see no reference to JaCoCo whatsoever. Is this normal? Shouldn't it be complaining that it doesn't find the report?
Here is the log, if it is of any help:

---------
[workspace] $ "C:\Program Files\Java\jdk1.6.0_29/bin/java" -cp F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-runner2077663624405859409.jar;F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-batch-bootstrapper978396760416267637.jar org.sonar.runner.Main -Dsonar.host.url=http://melian:8181/sonar -Dsources=src/main/java/ -Dsonar.dynamicAnalysis=reuseReports -Dtests=src/test/java/ -Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.surefire.reportsPath=test-reports -Dsonar.java.target=1.6 -Dsonar.jacoco.reportPath=coverage/report/jacoco.exec -Dsonar.projectVersion=1.0 -Dsonar.projectKey=pcr:unit_test -Dlibraries=./lib/cplex.jar,./lib/jdom.jar,./lib/log4j-1.3alpha-6.jar -Dbinaries=classes -Dsonar.java.source=1.6 -Dsonar.projectName="PCR"
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
OS name: "Windows 2003", version: "5.2", arch: "amd64"
Server: http://melian:8181/sonar
Work directory: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.sonar
[INFO]  Database dialect class org.sonar.jpa.dialect.Derby
[INFO]  Initializing Hibernate
[INFO]  -------------  Analyzing PCR
[INFO]  Selected quality profile : [name=Sonar way with Findbugs,language=java]
[INFO]  Configure maven plugins...
[INFO]  Compare to previous analysis (2012-06-22)
[INFO]  Compare over 5 days (2012-06-17, analysis of 2012-06-18 17:45:25.154)
[INFO]  Compare over 30 days (2012-05-23, analysis of 2012-05-25 11:39:15.15)
[INFO]  Sensor JavaSourceImporter...
[INFO]  Sensor JavaSourceImporter done: 3000 ms
[INFO]  Sensor SquidSensor...
[INFO]  Java AST scan...
[INFO]  Java AST scan done: 4515 ms
[INFO]  Java bytecode scan...
[INFO]  Java bytecode scan done: 2468 ms
[INFO]  Java Squid scan...
[INFO]  Java Squid scan done: 15 ms
[INFO]  Squid extraction...
[INFO]  Package design analysis...
[INFO]  Package design analysis done: 2328 ms
[INFO]  Squid extraction done: 7281 ms
[INFO]  Sensor SquidSensor done: 14702 ms
[INFO]  Sensor FindbugsSensor...
[INFO]  Execute Findbugs 1.3.9...
[INFO]  Found findbugs plugin: file:/C:/WINDOWS/TEMP/sonar-batch54720348958202792076553354435695/plugins/findbugs/META-INF/lib/findbugs-1.3.9.jar
[INFO]  Loaded plugin edu.umd.cs.findbugs.plugins.core
[INFO]  Findbugs output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\findbugs-result.xml
[INFO]  Execute Findbugs 1.3.9 done: 59655 ms
[INFO]  Sensor FindbugsSensor done: 60390 ms
[INFO]  Sensor SurefireSensor...
[INFO]  parsing F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\test-reports
[INFO]  Sensor SurefireSensor done: 234 ms
[INFO]  Sensor CpdSensor...
[INFO]  Sensor CpdSensor done: 703 ms
[INFO]  Sensor CheckstyleSensor...
[INFO]  Execute Checkstyle 5.1...
[INFO]  Checkstyle configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\checkstyle.xml
[INFO]  Execute Checkstyle 5.1 done: 4484 ms
[INFO]  Sensor CheckstyleSensor done: 4500 ms
[INFO]  Sensor PmdSensor...
[INFO]  Execute PMD 4.2.5...
[INFO]  Java version: 1.6
[INFO]  PMD configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd.xml
[INFO]  PMD output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd-result.xml
[INFO]  Execute PMD 4.2.5 done: 19859 ms
[INFO]  Sensor PmdSensor done: 20484 ms
[INFO]  Sensor ProfileSensor...
[INFO]  Sensor ProfileSensor done: 1125 ms
[INFO]  Sensor ProfileEventsSensor...
[INFO]  Sensor ProfileEventsSensor done: 47 ms
[INFO]  Sensor VersionEventsSensor...
[INFO]  Sensor VersionEventsSensor done: 31 ms
[INFO]  Execute decorators...
[INFO]  ANALYSIS SUCCESSFUL, you can browse http://melian:8181/sonar
[INFO]  Executing post-job class org.sonar.plugins.dbcleaner.runner.PurgeRunner
[INFO]  Database optimization...
***Ommitted for brevity****
[INFO]  There are no snapshots to purge
[INFO]  Purge org.sonar.plugins.dbcleaner.period.PeriodPurge done: 969 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies done: 1734 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews done: 32 ms
[INFO]  Database optimization done: 28890 ms
Total time: 3:04.434s
Final Memory: 20M/803M
Recording test results
[DEBUG] Skipping watched dependency update; build not configured with trigger: pcr-algo-dev_PCR #45
Finished: SUCCESS
---------

Thanks again,

Gilles.

On Fri, Jun 22, 2012 at 6:21 PM, David Racodon <[hidden email]> wrote:
Hi Gilles,

Everything seems correct to me.
Have you checked whether your JaCoCo report would be empty or not?

Maybe you can compare with the example. There's maybe a slight difference: http://docs.codehaus.org/display/SONAR/Sonar+Project+Examples


Regards,

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:11, Gilles Scouvart <[hidden email]> wrote:
Hello all,

I'm new to Sonar, and I'm setting it up for the continuous integration of my Java project, which is built using Jenkins with an Ant configuration.
I'm using the Jenkins Sonar plugin, and running Sonar in standalone mode. It already gives a lot of useful metrics, but I would like to see the unit test reports and most importantly, the coverage report in Sonar.
Therefore, I have
  • added a JaCoCo task in my Ant build
  • activated Sonar reuseReport: sonar.dynamicAnalysis=reuseReports
  • specified explicitly the JaCoCo plugin for code coverage: sonar.core.codeCoveragePlugin=jacoco
  • specified the path to the JaCoCo exec report file: sonar.jacoco.reportPath=coverage/report/jacoco.exec

I have verified that the correct output is written in the workspace. However, the code coverage information does not show up in the Sonar report.
Could someone tell me what I'm doing wrong here?

Many thanks for your help,

Gilles Scouvart.




Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code coverage using Sonar, Jenkins and Ant

Gilles Scouvart
Hi Freddy,

I'm using version 2.10 apparently. I'm now trying the ant task, but will upgrade if I have no luck.
BTW, is there a way to send arguments for the JVM that will be started for the tests? I need to specify java.library.path...

Thanks for your support,

Gilles.

On Sun, Jun 24, 2012 at 7:32 PM, Freddy Mallet <[hidden email]> wrote:
Hi Gilles,

Which Sonar version are you using because looks like you're not using the last one and the version you're using doesn't seem to embed Jacoco ? 

Thanks
Freddy
-----
Sonar for Continuous Inspection



On Fri, Jun 22, 2012 at 7:19 PM, David Racodon <[hidden email]> wrote:
Hi Gilles,

From what I can see, you seem to use the Sonar Runner to launch your Sonar analysis:
...
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
...

I thought you had an Ant project...

Could you start first to run the examples below?:
and once it's working, add your project specificities.

Thank you

Regards,


David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:44, Gilles Scouvart <[hidden email]> wrote:
Hi David,

Thanks for your swift response.
The report is 415KB large, so I suppose it is not empty. Meanwhile, I also output the HTML report, which seems to be full with relevant data.
I have copied the configuration recommended, and now I get the unit test report, but still not the coverage.
In the console output, I see no reference to JaCoCo whatsoever. Is this normal? Shouldn't it be complaining that it doesn't find the report?
Here is the log, if it is of any help:

---------
[workspace] $ "C:\Program Files\Java\jdk1.6.0_29/bin/java" -cp F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-runner2077663624405859409.jar;F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-batch-bootstrapper978396760416267637.jar org.sonar.runner.Main -Dsonar.host.url=http://melian:8181/sonar -Dsources=src/main/java/ -Dsonar.dynamicAnalysis=reuseReports -Dtests=src/test/java/ -Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.surefire.reportsPath=test-reports -Dsonar.java.target=1.6 -Dsonar.jacoco.reportPath=coverage/report/jacoco.exec -Dsonar.projectVersion=1.0 -Dsonar.projectKey=pcr:unit_test -Dlibraries=./lib/cplex.jar,./lib/jdom.jar,./lib/log4j-1.3alpha-6.jar -Dbinaries=classes -Dsonar.java.source=1.6 -Dsonar.projectName="PCR"
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
OS name: "Windows 2003", version: "5.2", arch: "amd64"
Server: http://melian:8181/sonar
Work directory: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.sonar
[INFO]  Database dialect class org.sonar.jpa.dialect.Derby
[INFO]  Initializing Hibernate
[INFO]  -------------  Analyzing PCR
[INFO]  Selected quality profile : [name=Sonar way with Findbugs,language=java]
[INFO]  Configure maven plugins...
[INFO]  Compare to previous analysis (2012-06-22)
[INFO]  Compare over 5 days (2012-06-17, analysis of 2012-06-18 17:45:25.154)
[INFO]  Compare over 30 days (2012-05-23, analysis of 2012-05-25 11:39:15.15)
[INFO]  Sensor JavaSourceImporter...
[INFO]  Sensor JavaSourceImporter done: 3000 ms
[INFO]  Sensor SquidSensor...
[INFO]  Java AST scan...
[INFO]  Java AST scan done: 4515 ms
[INFO]  Java bytecode scan...
[INFO]  Java bytecode scan done: 2468 ms
[INFO]  Java Squid scan...
[INFO]  Java Squid scan done: 15 ms
[INFO]  Squid extraction...
[INFO]  Package design analysis...
[INFO]  Package design analysis done: 2328 ms
[INFO]  Squid extraction done: 7281 ms
[INFO]  Sensor SquidSensor done: 14702 ms
[INFO]  Sensor FindbugsSensor...
[INFO]  Execute Findbugs 1.3.9...
[INFO]  Found findbugs plugin: file:/C:/WINDOWS/TEMP/sonar-batch54720348958202792076553354435695/plugins/findbugs/META-INF/lib/findbugs-1.3.9.jar
[INFO]  Loaded plugin edu.umd.cs.findbugs.plugins.core
[INFO]  Findbugs output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\findbugs-result.xml
[INFO]  Execute Findbugs 1.3.9 done: 59655 ms
[INFO]  Sensor FindbugsSensor done: 60390 ms
[INFO]  Sensor SurefireSensor...
[INFO]  parsing F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\test-reports
[INFO]  Sensor SurefireSensor done: 234 ms
[INFO]  Sensor CpdSensor...
[INFO]  Sensor CpdSensor done: 703 ms
[INFO]  Sensor CheckstyleSensor...
[INFO]  Execute Checkstyle 5.1...
[INFO]  Checkstyle configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\checkstyle.xml
[INFO]  Execute Checkstyle 5.1 done: 4484 ms
[INFO]  Sensor CheckstyleSensor done: 4500 ms
[INFO]  Sensor PmdSensor...
[INFO]  Execute PMD 4.2.5...
[INFO]  Java version: 1.6
[INFO]  PMD configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd.xml
[INFO]  PMD output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd-result.xml
[INFO]  Execute PMD 4.2.5 done: 19859 ms
[INFO]  Sensor PmdSensor done: 20484 ms
[INFO]  Sensor ProfileSensor...
[INFO]  Sensor ProfileSensor done: 1125 ms
[INFO]  Sensor ProfileEventsSensor...
[INFO]  Sensor ProfileEventsSensor done: 47 ms
[INFO]  Sensor VersionEventsSensor...
[INFO]  Sensor VersionEventsSensor done: 31 ms
[INFO]  Execute decorators...
[INFO]  ANALYSIS SUCCESSFUL, you can browse http://melian:8181/sonar
[INFO]  Executing post-job class org.sonar.plugins.dbcleaner.runner.PurgeRunner
[INFO]  Database optimization...
***Ommitted for brevity****
[INFO]  There are no snapshots to purge
[INFO]  Purge org.sonar.plugins.dbcleaner.period.PeriodPurge done: 969 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies done: 1734 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews done: 32 ms
[INFO]  Database optimization done: 28890 ms
Total time: 3:04.434s
Final Memory: 20M/803M
Recording test results
[DEBUG] Skipping watched dependency update; build not configured with trigger: pcr-algo-dev_PCR #45
Finished: SUCCESS
---------

Thanks again,

Gilles.

On Fri, Jun 22, 2012 at 6:21 PM, David Racodon <[hidden email]> wrote:
Hi Gilles,

Everything seems correct to me.
Have you checked whether your JaCoCo report would be empty or not?

Maybe you can compare with the example. There's maybe a slight difference: http://docs.codehaus.org/display/SONAR/Sonar+Project+Examples


Regards,

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:11, Gilles Scouvart <[hidden email]> wrote:
Hello all,

I'm new to Sonar, and I'm setting it up for the continuous integration of my Java project, which is built using Jenkins with an Ant configuration.
I'm using the Jenkins Sonar plugin, and running Sonar in standalone mode. It already gives a lot of useful metrics, but I would like to see the unit test reports and most importantly, the coverage report in Sonar.
Therefore, I have
  • added a JaCoCo task in my Ant build
  • activated Sonar reuseReport: sonar.dynamicAnalysis=reuseReports
  • specified explicitly the JaCoCo plugin for code coverage: sonar.core.codeCoveragePlugin=jacoco
  • specified the path to the JaCoCo exec report file: sonar.jacoco.reportPath=coverage/report/jacoco.exec

I have verified that the correct output is written in the workspace. However, the code coverage information does not show up in the Sonar report.
Could someone tell me what I'm doing wrong here?

Many thanks for your help,

Gilles Scouvart.





Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Code coverage using Sonar, Jenkins and Ant

David Racodon-2
Hi Gilles,

OK, prior to version 2.12, JaCoCo was not embedded in Sonar and you needed to add a plugin:  http://docs.codehaus.org/display/SONAR/JaCoCo+Plugin. Thus it can't work if you have not installed this plugin.
So, I highly recommend you to upgrade to version 3.1 and analyze you project with the Ant task.

Keep us posted

Thank you

Regards,

David RACODON | SonarSource
Senior Consultant



On 25 June 2012 14:40, Gilles Scouvart <[hidden email]> wrote:
Hi Freddy,

I'm using version 2.10 apparently. I'm now trying the ant task, but will upgrade if I have no luck.
BTW, is there a way to send arguments for the JVM that will be started for the tests? I need to specify java.library.path...

Thanks for your support,

Gilles.

On Sun, Jun 24, 2012 at 7:32 PM, Freddy Mallet <[hidden email]> wrote:
Hi Gilles,

Which Sonar version are you using because looks like you're not using the last one and the version you're using doesn't seem to embed Jacoco ? 

Thanks
Freddy
-----
Sonar for Continuous Inspection



On Fri, Jun 22, 2012 at 7:19 PM, David Racodon <[hidden email]> wrote:
Hi Gilles,

From what I can see, you seem to use the Sonar Runner to launch your Sonar analysis:
...
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
...

I thought you had an Ant project...

Could you start first to run the examples below?:
and once it's working, add your project specificities.

Thank you

Regards,


David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:44, Gilles Scouvart <[hidden email]> wrote:
Hi David,

Thanks for your swift response.
The report is 415KB large, so I suppose it is not empty. Meanwhile, I also output the HTML report, which seems to be full with relevant data.
I have copied the configuration recommended, and now I get the unit test report, but still not the coverage.
In the console output, I see no reference to JaCoCo whatsoever. Is this normal? Shouldn't it be complaining that it doesn't find the report?
Here is the log, if it is of any help:

---------
[workspace] $ "C:\Program Files\Java\jdk1.6.0_29/bin/java" -cp F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-runner2077663624405859409.jar;F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\sonar-batch-bootstrapper978396760416267637.jar org.sonar.runner.Main -Dsonar.host.url=http://melian:8181/sonar -Dsources=src/main/java/ -Dsonar.dynamicAnalysis=reuseReports -Dtests=src/test/java/ -Dsonar.core.codeCoveragePlugin=jacoco -Dsonar.surefire.reportsPath=test-reports -Dsonar.java.target=1.6 -Dsonar.jacoco.reportPath=coverage/report/jacoco.exec -Dsonar.projectVersion=1.0 -Dsonar.projectKey=pcr:unit_test -Dlibraries=./lib/cplex.jar,./lib/jdom.jar,./lib/log4j-1.3alpha-6.jar -Dbinaries=classes -Dsonar.java.source=1.6 -Dsonar.projectName="PCR"
Runner configuration file: NONE
Project configuration file: NONE
Runner version: 1.2
Java version: 1.6.0_33, vendor: Sun Microsystems Inc.
OS name: "Windows 2003", version: "5.2", arch: "amd64"
Server: http://melian:8181/sonar
Work directory: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.sonar
[INFO]  Database dialect class org.sonar.jpa.dialect.Derby
[INFO]  Initializing Hibernate
[INFO]  -------------  Analyzing PCR
[INFO]  Selected quality profile : [name=Sonar way with Findbugs,language=java]
[INFO]  Configure maven plugins...
[INFO]  Compare to previous analysis (2012-06-22)
[INFO]  Compare over 5 days (2012-06-17, analysis of 2012-06-18 17:45:25.154)
[INFO]  Compare over 30 days (2012-05-23, analysis of 2012-05-25 11:39:15.15)
[INFO]  Sensor JavaSourceImporter...
[INFO]  Sensor JavaSourceImporter done: 3000 ms
[INFO]  Sensor SquidSensor...
[INFO]  Java AST scan...
[INFO]  Java AST scan done: 4515 ms
[INFO]  Java bytecode scan...
[INFO]  Java bytecode scan done: 2468 ms
[INFO]  Java Squid scan...
[INFO]  Java Squid scan done: 15 ms
[INFO]  Squid extraction...
[INFO]  Package design analysis...
[INFO]  Package design analysis done: 2328 ms
[INFO]  Squid extraction done: 7281 ms
[INFO]  Sensor SquidSensor done: 14702 ms
[INFO]  Sensor FindbugsSensor...
[INFO]  Execute Findbugs 1.3.9...
[INFO]  Found findbugs plugin: file:/C:/WINDOWS/TEMP/sonar-batch54720348958202792076553354435695/plugins/findbugs/META-INF/lib/findbugs-1.3.9.jar
[INFO]  Loaded plugin edu.umd.cs.findbugs.plugins.core
[INFO]  Findbugs output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\findbugs-result.xml
[INFO]  Execute Findbugs 1.3.9 done: 59655 ms
[INFO]  Sensor FindbugsSensor done: 60390 ms
[INFO]  Sensor SurefireSensor...
[INFO]  parsing F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\test-reports
[INFO]  Sensor SurefireSensor done: 234 ms
[INFO]  Sensor CpdSensor...
[INFO]  Sensor CpdSensor done: 703 ms
[INFO]  Sensor CheckstyleSensor...
[INFO]  Execute Checkstyle 5.1...
[INFO]  Checkstyle configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\checkstyle.xml
[INFO]  Execute Checkstyle 5.1 done: 4484 ms
[INFO]  Sensor CheckstyleSensor done: 4500 ms
[INFO]  Sensor PmdSensor...
[INFO]  Execute PMD 4.2.5...
[INFO]  Java version: 1.6
[INFO]  PMD configuration: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd.xml
[INFO]  PMD output report: F:\hudson\.hudson\jobs\pcr-algo-dev_PCR\workspace\.\.sonar\pmd-result.xml
[INFO]  Execute PMD 4.2.5 done: 19859 ms
[INFO]  Sensor PmdSensor done: 20484 ms
[INFO]  Sensor ProfileSensor...
[INFO]  Sensor ProfileSensor done: 1125 ms
[INFO]  Sensor ProfileEventsSensor...
[INFO]  Sensor ProfileEventsSensor done: 47 ms
[INFO]  Sensor VersionEventsSensor...
[INFO]  Sensor VersionEventsSensor done: 31 ms
[INFO]  Execute decorators...
[INFO]  ANALYSIS SUCCESSFUL, you can browse http://melian:8181/sonar
[INFO]  Executing post-job class org.sonar.plugins.dbcleaner.runner.PurgeRunner
[INFO]  Database optimization...
***Ommitted for brevity****
[INFO]  There are no snapshots to purge
[INFO]  Purge org.sonar.plugins.dbcleaner.period.PeriodPurge done: 969 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeDependencies done: 1734 ms
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews...
[INFO]  Purge org.sonar.plugins.dbcleaner.purges.PurgeOrphanReviews done: 32 ms
[INFO]  Database optimization done: 28890 ms
Total time: 3:04.434s
Final Memory: 20M/803M
Recording test results
[DEBUG] Skipping watched dependency update; build not configured with trigger: pcr-algo-dev_PCR #45
Finished: SUCCESS
---------

Thanks again,

Gilles.

On Fri, Jun 22, 2012 at 6:21 PM, David Racodon <[hidden email]> wrote:
Hi Gilles,

Everything seems correct to me.
Have you checked whether your JaCoCo report would be empty or not?

Maybe you can compare with the example. There's maybe a slight difference: http://docs.codehaus.org/display/SONAR/Sonar+Project+Examples


Regards,

David RACODON | SonarSource
Senior Consultant



On 22 June 2012 18:11, Gilles Scouvart <[hidden email]> wrote:
Hello all,

I'm new to Sonar, and I'm setting it up for the continuous integration of my Java project, which is built using Jenkins with an Ant configuration.
I'm using the Jenkins Sonar plugin, and running Sonar in standalone mode. It already gives a lot of useful metrics, but I would like to see the unit test reports and most importantly, the coverage report in Sonar.
Therefore, I have
  • added a JaCoCo task in my Ant build
  • activated Sonar reuseReport: sonar.dynamicAnalysis=reuseReports
  • specified explicitly the JaCoCo plugin for code coverage: sonar.core.codeCoveragePlugin=jacoco
  • specified the path to the JaCoCo exec report file: sonar.jacoco.reportPath=coverage/report/jacoco.exec

I have verified that the correct output is written in the workspace. However, the code coverage information does not show up in the Sonar report.
Could someone tell me what I'm doing wrong here?

Many thanks for your help,

Gilles Scouvart.






Loading...