[
https://issues.jboss.org/browse/JBIDE-23155?page=com.atlassian.jira.plugi...
]
Andre Dietisheim edited comment on JBIDE-23155 at 9/15/16 11:19 AM:
--------------------------------------------------------------------
To have sonar reporting test coverage one has to include cobertura or jacoco in the build.
Sonar will then pick up the report that was generated as long as required properties are
configured correctly.
To add jacoco to our build the following has to be added to pom:
{code:title=http://www.eclemma.org/jacoco/trunk/doc/examples/build/pom.xml}
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.8-SNAPSHOT</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<!-- implementation is needed only for Maven 2 -->
<rule
implementation="org.jacoco.maven.RuleConfiguration">
<element>BUNDLE</element>
<limits>
<!-- implementation is needed only for Maven 2
-->
<limit
implementation="org.jacoco.report.check.Limit">
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
{code}
docs for integrating jacoco are here:
http://docs.sonarqube.org/display/PLUG/Usage+of+JaCoCo+with+Java+Plugin
was (Author: adietish):
To have sonar reporting test coverage one has to include cobertura or jacoco in the build.
Sonar will then pick up the report that was generated as long as required properties are
configured correctly.
To add jacoco to our build the following has to be added to pom:
{code:title=http://www.eclemma.org/jacoco/trunk/doc/examples/build/pom.xml}
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.8-SNAPSHOT</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules>
<!-- implementation is needed only for Maven 2 -->
<rule
implementation="org.jacoco.maven.RuleConfiguration">
<element>BUNDLE</element>
<limits>
<!-- implementation is needed only for Maven 2
-->
<limit
implementation="org.jacoco.report.check.Limit">
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.60</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
{code}
tests: sonar should report test coverage
----------------------------------------
Key: JBIDE-23155
URL:
https://issues.jboss.org/browse/JBIDE-23155
Project: Tools (JBoss Tools)
Issue Type: Sub-task
Components: openshift
Affects Versions: 4.4.1.Final
Reporter: Andre Dietisheim
Fix For: 4.4.x
I'd be great if our sonar instance at
sonarqube.com would report test coverage.
Docs are here:
http://docs.sonarqube.org/display/PLUG/Code+Coverage+by+Unit+Tests+for+Ja...
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)