|
I’m using ant task and processing pre-generated reports. This ant target is unchanged from the 30 to 3.2 upgrade <sonar:sonar workDir="${sonar.tmp.dir}" key="com.company:${ant.project.name}" version="${project.version}"> <!-- Properties defining Sonar server location and access defined in project build.properties--> <!-- source directories (required) --> <sources path="${src.main.java.dir}"/> <!-- binaries directories, the compiled Java bytecode (optional) --> <binaries path="${package.dir}"/> <!-- test source directories (optional) --> <tests path="${src.test.java.dir}"/> <!-- path to libraries (optional). Component jar file dependencies --> <libraries refid="build.binary.classpath"/> <!-- list analysis of properties (optional) - see http://docs.codehaus.org/display/SONAR/Advanced+parameters - configured to reuse the unit test and coverage reports generated during the build phases --> <property key="sonar.projectName" value="${ant.project.name}" /> <property key="sonar.dynamicAnalysis" value="reuseReports" /> <property key="sonar.surefire.reportsPath" value="${junit.reports.dir}" /> <property key="sonar.cobertura.reportPath" value="${cobertura.coverage.file}" /> </sonar:sonar> I’m seeing this in my log, (Some anonymizing, otherwise this is it) [exec] [sonar:sonar] 00:24:03.756 INFO .s.b.b.ProjectModule - ------------- Analyzing PROJECT [exec] [sonar:sonar] 00:24:03.938 INFO .s.b.ProfileProvider - Selected quality profile : [name=Master,language=java] [exec] [sonar:sonar] 00:24:03.959 INFO nPluginsConfigurator - Configure maven plugins... [exec] [sonar:sonar] 00:24:03.997 INFO org.sonar.INFO - Compare to previous analysis (2012-09-09) [exec] [sonar:sonar] 00:24:04.043 INFO org.sonar.INFO - Compare over 5 days (2012-09-05, analysis of 2012-09-07 00:24:35.0) [exec] [sonar:sonar] 00:24:04.056 INFO org.sonar.INFO - Compare over 30 days (2012-08-11, analysis of 2012-08-11 00:35:36.0) [exec] [sonar:sonar] 00:24:04.305 INFO .b.p.SensorsExecutor - Initializer ProjectFileSystemLogger... [exec] [sonar:sonar] 00:24:04.308 INFO jectFileSystemLogger - Source directories: [exec] [sonar:sonar] 00:24:04.308 INFO jectFileSystemLogger - .../src/main/java [exec] [sonar:sonar] 00:24:04.308 INFO jectFileSystemLogger - Test directories: [exec] [sonar:sonar] 00:24:04.308 INFO jectFileSystemLogger - .../src/test/java [exec] [sonar:sonar] 00:24:04.308 INFO .b.p.SensorsExecutor - Initializer ProjectFileSystemLogger done: 3 ms [exec] [sonar:sonar] 00:24:05.689 INFO p.PhasesTimeProfiler - Sensor JavaSourceImporter... [exec] [sonar:sonar] 00:24:16.119 INFO p.PhasesTimeProfiler - Sensor JavaSourceImporter done: 10430 ms [exec] [sonar:sonar] 00:24:16.119 INFO p.PhasesTimeProfiler - Sensor SquidSensor... [exec] [sonar:sonar] 00:24:16.679 INFO .s.p.s.SquidExecutor - Java AST scan... [exec] [sonar:sonar] 00:24:26.736 INFO .s.p.s.SquidExecutor - Java AST scan done: 10057 ms [exec] [sonar:sonar] 00:24:27.606 INFO .s.p.s.SquidExecutor - Java bytecode scan... [exec] [sonar:sonar] 00:24:58.085 INFO .s.p.s.SquidExecutor - Java bytecode scan done: 30480 ms [exec] [sonar:sonar] 00:24:58.193 INFO .s.p.s.SquidExecutor - Java Squid scan... [exec] [sonar:sonar] 00:24:58.218 INFO .s.p.s.SquidExecutor - Java Squid scan done: 25 ms [exec] [sonar:sonar] 00:24:58.219 INFO .s.p.s.SquidExecutor - Squid extraction... [exec] [sonar:sonar] 00:24:58.426 INFO s.p.s.b.DesignBridge - Package design analysis... [exec] [sonar:sonar] 00:25:01.066 INFO s.p.s.b.DesignBridge - Package design analysis done: 2640 ms [exec] [sonar:sonar] 00:25:02.642 INFO .s.p.s.SquidExecutor - Squid extraction done: 4423 ms [exec] [sonar:sonar] 00:25:02.855 INFO p.PhasesTimeProfiler - Sensor SquidSensor done: 46736 ms [exec] [sonar:sonar] 00:25:02.856 INFO p.PhasesTimeProfiler - Sensor com.hello2morrow.sonarplugin.api.SonargraphSensor@20724356... [exec] [sonar:sonar] 00:25:02.858 INFO s.a.SonargraphSensor - ------------------------------------------------------------------------ [exec] [sonar:sonar] 00:25:02.858 INFO s.a.SonargraphSensor - Execute sonar-sonargraph-plugin for PROJECT [exec] [sonar:sonar] 00:25:02.858 INFO s.a.SonargraphSensor - ------------------------------------------------------------------------ [exec] [sonar:sonar] 00:25:02.860 INFO s.f.ReportFileReader - Reading Sonargraph metrics report from: .../target/reports/sonar/tmp/target/sonargraph-sonar-plugin/sonargraph-sonar-report.xml [exec] [sonar:sonar] 00:25:02.862 ERROR s.f.ReportFileReader - Cannot open Sonargraph report: .../target/reports/sonar/tmp/target/sonargraph-sonar-plugin/sonargraph-sonar-report.xml. [exec] [sonar:sonar] 00:25:02.862 ERROR s.f.ReportFileReader - Maven: Did you run the maven sonargraph goal before with the POM option <prepareForSonar>true</prepareForSonar>
or with the commandline option -Dsonargraph.prepareForSonar=true? [exec] [sonar:sonar] 00:25:02.862 ERROR s.f.ReportFileReader - Ant: Did you create the Sonargraph XML report with the option prepareForSonar set on true? (You can use the
property 'sonar.sonargraph.report.path' to point to the location of the XML report [exec] [sonar:sonar] 00:25:02.862 ERROR s.a.SonargraphSensor - No Sonargraph build units found in report for [PROJECT]. Module will not be processed by Sonargraph! [exec] [sonar:sonar] 00:25:02.862 INFO p.PhasesTimeProfiler - Sensor com.hello2morrow.sonarplugin.api.SonargraphSensor@20724356 done: 6 ms [exec] [sonar:sonar] 00:25:02.863 INFO p.PhasesTimeProfiler - Sensor CpdSensor... [exec] [sonar:sonar] 00:25:02.863 INFO o.s.p.cpd.CpdSensor - SonarEngine is used [exec] [sonar:sonar] 00:25:03.521 INFO s.p.c.i.IndexFactory - Cross-project analysis disabled [exec] [sonar:sonar] 00:25:06.294 INFO p.PhasesTimeProfiler - Sensor CpdSensor done: 3431 ms [exec] [sonar:sonar] 00:25:06.297 INFO p.PhasesTimeProfiler - Sensor JaCoCoSensor... [exec] [sonar:sonar] 00:25:06.321 INFO o.s.p.j.JaCoCoPlugin - Project coverage is set to 0% as no JaCoCo execution data has been dumped: .../target/jacoco.exec [exec] [sonar:sonar] 00:25:25.590 INFO p.PhasesTimeProfiler - Sensor JaCoCoSensor done: 19293 ms [exec] [sonar:sonar] 00:25:25.590 INFO p.PhasesTimeProfiler - Sensor SurefireSensor... [exec] [sonar:sonar] 00:25:25.592 INFO s.p.s.SurefireSensor - parsing .../target/reports/junit [exec] [sonar:sonar] 00:25:28.746 INFO p.PhasesTimeProfiler - Sensor SurefireSensor done: 3156 ms [exec] [sonar:sonar] 00:25:28.746 INFO p.PhasesTimeProfiler - Sensor ProfileSensor... [exec] [sonar:sonar] 00:25:28.756 INFO p.PhasesTimeProfiler - Sensor ProfileSensor done: 10 ms [exec] [sonar:sonar] 00:25:28.756 INFO p.PhasesTimeProfiler - Sensor ProfileEventsSensor... [exec] [sonar:sonar] 00:25:28.782 INFO p.PhasesTimeProfiler - Sensor ProfileEventsSensor done: 26 ms [exec] [sonar:sonar] 00:25:28.782 INFO p.PhasesTimeProfiler - Sensor VersionEventsSensor... [exec] [sonar:sonar] 00:25:28.810 INFO p.PhasesTimeProfiler - Sensor VersionEventsSensor done: 28 ms [exec] [sonar:sonar] 00:25:29.458 INFO p.PhasesTimeProfiler - Execute decorators... [exec] [sonar:sonar] 00:26:15.262 INFO .b.p.UpdateStatusJob - ANALYSIS SUCCESSFUL, you can browse http://server/ Looks like it is trying to find a JaCoCo report and is not finding the cobertura report that I have provided. Would like to understand the sonargraph issue as well, but not getting my coverage data is the bigger real at the moment. Thanks Daniel From: Anuradha, Subhashni
Hi Daniel, Can you please look into this url you sent me? Everything is red and code coverage percentage is showing up as 0%. It was 22.1% yesterday. Did something break? Thanks, Subhashni
From: Holmes, Daniel
You should be able to get this from the Sonar tool. http://bard-quality.gdl.englab.netapp.com:9000/dashboard/index/6208 Lines (really should be called Statement) and branch coverage is available. Looks like Classes and Methods aren’t reported here although they could be determined
from the raw cobertura data. In reality though these aren’t really of any value because they are artificially inflated because just one line in a class or method makes it count 100%. Daniel From: Anuradha, Subhashni
Is there any way to just get an average for all web-ui? I’m assuming that’s what you mean by top level numbers. John doesn’t want file by file info for the report I’m working on. From: Holmes, Daniel
You want just top level numbers or are you looking for file by file level info? From: Anuradha, Subhashni
Sorry…I’m referring to the coverage report at
https://bard-quality.gdl.englab.netapp.com/job/bard_main_test/275/cobertura/? From: Anuradha, Subhashni
Hi Daniel, John Z asked me to speak with you for guidance on how to run a report for web_ui only covering the following categories: * Classes * Methods * Lines I need just the percentage, not the visual chart. I need to do an average for all web_ui line items. Thanks, Subhashni Anuradha NetApp
|
|
Hi Daniel
Since 3.1 the default code coverage tool in Sonar is Jacoco, so if you want to use Cobertura then you should explicitly define it in global or project settings under Code Coverage category.
2012/9/10 Holmes, Daniel <[hidden email]>
|
|
In reply to this post by Holmes, Daniel
Hi,
Sonar 3.2 makes JaCoCo a default coverage engine (SONAR-3536), so to use Cobertura you need "sonar.core.codeCoveragePlugin=cobertura".
On Mon, Sep 10, 2012 at 6:40 PM, Holmes, Daniel <[hidden email]> wrote:
Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
|
OK, I’ll give this a try. I did not see it mentioned in the Installation and Upgrade notes. Would probably have been good to add. Daniel From: Evgeny Mandrikov [mailto:[hidden email]]
Hi, Sonar 3.2 makes JaCoCo a default coverage engine (SONAR-3536), so to use Cobertura you need "sonar.core.codeCoveragePlugin=cobertura". On Mon, Sep 10, 2012 at 6:40 PM, Holmes, Daniel <[hidden email]> wrote: I’m using ant task and processing pre-generated reports. This ant target is unchanged from the 30
to 3.2 upgrade <sonar:sonar workDir="${sonar.tmp.dir}" key="com.company:${ant.project.name}" version="${project.version}"> <!-- Properties defining Sonar server location and access defined in project build.properties--> <!-- source directories (required) --> <sources path="${src.main.java.dir}"/> <!-- binaries directories, the compiled Java bytecode (optional) --> <binaries path="${package.dir}"/> <!-- test source directories (optional) --> <tests path="${src.test.java.dir}"/> <!-- path to libraries (optional). Component jar file dependencies --> <libraries refid="build.binary.classpath"/> <!-- list analysis of properties (optional) - see
http://docs.codehaus.org/display/SONAR/Advanced+parameters - configured to reuse the unit test and coverage reports generated during the build
phases --> <property key="sonar.projectName" value="${ant.project.name}"
/> <property key="sonar.dynamicAnalysis" value="reuseReports" /> <property key="sonar.surefire.reportsPath" value="${junit.reports.dir}" /> <property key="sonar.cobertura.reportPath" value="${cobertura.coverage.file}" /> </sonar:sonar> I’m seeing this in my log, (Some anonymizing, otherwise this is it) [exec] [sonar:sonar] 00:24:03.756 INFO .s.b.b.ProjectModule - ------------- Analyzing PROJECT [exec] [sonar:sonar] 00:24:03.938 INFO .s.b.ProfileProvider - Selected quality profile : [name=Master,language=java] [exec] [sonar:sonar] 00:24:03.959 INFO nPluginsConfigurator - Configure maven plugins... [exec] [sonar:sonar] 00:24:03.997 INFO
org.sonar.INFO - Compare to previous analysis (2012-09-09) [exec] [sonar:sonar] 00:24:04.043 INFO
org.sonar.INFO - Compare over 5 days (2012-09-05, analysis of 2012-09-07 00:24:35.0) [exec] [sonar:sonar] 00:24:04.056 INFO
org.sonar.INFO - Compare over 30 days (2012-08-11, analysis of 2012-08-11 00:35:36.0) [exec] [sonar:sonar] 00:24:04.305 INFO .b.p.SensorsExecutor - Initializer ProjectFileSystemLogger... [exec] [sonar:sonar] 00:24:04.308 INFO jectFileSystemLogger - Source directories: [exec] [sonar:sonar] 00:24:04.308 INFO jectFileSystemLogger - .../src/main/java [exec] [sonar:sonar] 00:24:04.308 INFO jectFileSystemLogger - Test directories: [exec] [sonar:sonar] 00:24:04.308 INFO jectFileSystemLogger - .../src/test/java [exec] [sonar:sonar] 00:24:04.308 INFO .b.p.SensorsExecutor - Initializer ProjectFileSystemLogger done: 3 ms [exec] [sonar:sonar] 00:24:05.689 INFO p.PhasesTimeProfiler - Sensor JavaSourceImporter... [exec] [sonar:sonar] 00:24:16.119 INFO p.PhasesTimeProfiler - Sensor JavaSourceImporter done: 10430 ms [exec] [sonar:sonar] 00:24:16.119 INFO p.PhasesTimeProfiler - Sensor SquidSensor... [exec] [sonar:sonar] 00:24:16.679 INFO .s.p.s.SquidExecutor - Java AST scan... [exec] [sonar:sonar] 00:24:26.736 INFO .s.p.s.SquidExecutor - Java AST scan done: 10057 ms [exec] [sonar:sonar] 00:24:27.606 INFO .s.p.s.SquidExecutor - Java bytecode scan... [exec] [sonar:sonar] 00:24:58.085 INFO .s.p.s.SquidExecutor - Java bytecode scan done: 30480 ms [exec] [sonar:sonar] 00:24:58.193 INFO .s.p.s.SquidExecutor - Java Squid scan... [exec] [sonar:sonar] 00:24:58.218 INFO .s.p.s.SquidExecutor - Java Squid scan done: 25 ms [exec] [sonar:sonar] 00:24:58.219 INFO .s.p.s.SquidExecutor - Squid extraction... [exec] [sonar:sonar] 00:24:58.426 INFO s.p.s.b.DesignBridge - Package design analysis... [exec] [sonar:sonar] 00:25:01.066 INFO s.p.s.b.DesignBridge - Package design analysis done: 2640 ms [exec] [sonar:sonar] 00:25:02.642 INFO .s.p.s.SquidExecutor - Squid extraction done: 4423 ms [exec] [sonar:sonar] 00:25:02.855 INFO p.PhasesTimeProfiler - Sensor SquidSensor done: 46736 ms [exec] [sonar:sonar] 00:25:02.856 INFO p.PhasesTimeProfiler - Sensor
[hidden email]... [exec] [sonar:sonar] 00:25:02.858 INFO s.a.SonargraphSensor - ------------------------------------------------------------------------ [exec] [sonar:sonar] 00:25:02.858 INFO s.a.SonargraphSensor - Execute sonar-sonargraph-plugin for PROJECT [exec] [sonar:sonar] 00:25:02.858 INFO s.a.SonargraphSensor - ------------------------------------------------------------------------ [exec] [sonar:sonar] 00:25:02.860 INFO s.f.ReportFileReader - Reading Sonargraph metrics report from: .../target/reports/sonar/tmp/target/sonargraph-sonar-plugin/sonargraph-sonar-report.xml [exec] [sonar:sonar] 00:25:02.862 ERROR s.f.ReportFileReader - Cannot open Sonargraph report: .../target/reports/sonar/tmp/target/sonargraph-sonar-plugin/sonargraph-sonar-report.xml. [exec] [sonar:sonar] 00:25:02.862 ERROR s.f.ReportFileReader - Maven: Did you run the maven sonargraph goal before
with the POM option <prepareForSonar>true</prepareForSonar> or with the commandline option -Dsonargraph.prepareForSonar=true? [exec] [sonar:sonar] 00:25:02.862 ERROR s.f.ReportFileReader - Ant: Did you create the Sonargraph XML report with
the option prepareForSonar set on true? (You can use the property 'sonar.sonargraph.report.path' to point to the location of the XML report [exec] [sonar:sonar] 00:25:02.862 ERROR s.a.SonargraphSensor - No Sonargraph build units found in report for [PROJECT].
Module will not be processed by Sonargraph! [exec] [sonar:sonar] 00:25:02.862 INFO p.PhasesTimeProfiler - Sensor
[hidden email] done: 6 ms [exec] [sonar:sonar] 00:25:02.863 INFO p.PhasesTimeProfiler - Sensor CpdSensor... [exec] [sonar:sonar] 00:25:02.863 INFO o.s.p.cpd.CpdSensor - SonarEngine is used [exec] [sonar:sonar] 00:25:03.521 INFO s.p.c.i.IndexFactory - Cross-project analysis disabled [exec] [sonar:sonar] 00:25:06.294 INFO p.PhasesTimeProfiler - Sensor CpdSensor done: 3431 ms [exec] [sonar:sonar] 00:25:06.297 INFO p.PhasesTimeProfiler - Sensor JaCoCoSensor... [exec] [sonar:sonar] 00:25:06.321 INFO o.s.p.j.JaCoCoPlugin - Project coverage is set to 0% as no JaCoCo execution
data has been dumped: .../target/jacoco.exec [exec] [sonar:sonar] 00:25:25.590 INFO p.PhasesTimeProfiler - Sensor JaCoCoSensor done: 19293 ms [exec] [sonar:sonar] 00:25:25.590 INFO p.PhasesTimeProfiler - Sensor SurefireSensor... [exec] [sonar:sonar] 00:25:25.592 INFO s.p.s.SurefireSensor - parsing .../target/reports/junit [exec] [sonar:sonar] 00:25:28.746 INFO p.PhasesTimeProfiler - Sensor SurefireSensor done: 3156 ms [exec] [sonar:sonar] 00:25:28.746 INFO p.PhasesTimeProfiler - Sensor ProfileSensor... [exec] [sonar:sonar] 00:25:28.756 INFO p.PhasesTimeProfiler - Sensor ProfileSensor done: 10 ms [exec] [sonar:sonar] 00:25:28.756 INFO p.PhasesTimeProfiler - Sensor ProfileEventsSensor... [exec] [sonar:sonar] 00:25:28.782 INFO p.PhasesTimeProfiler - Sensor ProfileEventsSensor done: 26 ms [exec] [sonar:sonar] 00:25:28.782 INFO p.PhasesTimeProfiler - Sensor VersionEventsSensor... [exec] [sonar:sonar] 00:25:28.810 INFO p.PhasesTimeProfiler - Sensor VersionEventsSensor done: 28 ms [exec] [sonar:sonar] 00:25:29.458 INFO p.PhasesTimeProfiler - Execute decorators... [exec] [sonar:sonar] 00:26:15.262 INFO .b.p.UpdateStatusJob - ANALYSIS SUCCESSFUL, you can browse
http://server/ Looks like it is trying to find a JaCoCo report and is not finding the cobertura report that I have
provided. Would like to understand the sonargraph issue as well, but not getting my coverage data is the bigger
real at the moment. Thanks Daniel From: Anuradha, Subhashni
Hi Daniel, Can you please look into this url you sent me? Everything is red and code coverage percentage is showing
up as 0%. It was 22.1% yesterday. Did something break? Thanks, Subhashni
From: Holmes, Daniel
You should be able to get this from the Sonar tool. http://bard-quality.gdl.englab.netapp.com:9000/dashboard/index/6208 Lines (really should be called Statement) and branch coverage is available. Looks like Classes and
Methods aren’t reported here although they could be determined from the raw cobertura data. In reality though these aren’t really of any value because they are artificially inflated because just one line in a class or method makes it count 100%. Daniel From: Anuradha, Subhashni
Is there any way to just get an average for all web-ui? I’m assuming that’s what you mean by top level
numbers. John doesn’t want file by file info for the report I’m working on. From: Holmes, Daniel
You want just top level numbers or are you looking for file by file level info? From: Anuradha, Subhashni
Sorry…I’m referring to the coverage report at
https://bard-quality.gdl.englab.netapp.com/job/bard_main_test/275/cobertura/? From: Anuradha, Subhashni
Hi Daniel, John Z asked me to speak with you for guidance on how to run a report for web_ui only covering the following categories: * Classes * Methods * Lines I need just the percentage, not the visual chart. I need to do an average for all web_ui line items. Thanks, Subhashni Anuradha NetApp
-- |
|
Hi David, Indeed - as Daniel, I also believe that we should update release notes (and/or documentation). Could you please take care of this? On Mon, Sep 10, 2012 at 6:54 PM, Holmes, Daniel <[hidden email]> wrote:
Best regards, Evgeny Mandrikov aka Godin <http://godin.net.ru> http://twitter.com/_godin_ |
|
Hi guys,
Thanks for your feedback. Upgrade notes updated: http://docs.codehaus.org/display/SONAR/Release+3.2+Upgrade+Notes
Regards, David RACODON | SonarSource
Senior Consultant On 12 September 2012 11:31, Evgeny Mandrikov <[hidden email]> wrote:
|
| Powered by Nabble | Edit this page |
