Skip to content

Commit

Permalink
Switch Jacoco's code coverage format to XML reports (eclipse-hawkbit#882
Browse files Browse the repository at this point in the history
)

* jacoco xml report configuration
+ create exec files per module
+ introduce report aggregation in test report module
+ remove failsafe plugin usage
+ set xml report path for sonar

Signed-off-by: Natalia Kislicyn <[email protected]>

* add update-server dependency to test report

Signed-off-by: Natalia Kislicyn <[email protected]>

* Reorder elements in pom

Signed-off-by: Natalia Kislicyn <[email protected]>

* undo surefire / failsafe changes

Signed-off-by: Natalia Kislicyn <[email protected]>

* set remote sonar host

Signed-off-by: Natalia Kislicyn <[email protected]>
  • Loading branch information
Nkyn authored and Dominic Schabel committed Nov 8, 2019
1 parent eb182a3 commit af2ea84
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 31 deletions.
4 changes: 0 additions & 4 deletions hawkbit-dmf/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
<name>hawkBit :: DMF</name>
<packaging>pom</packaging>

<properties>
<jacoco.outputDir>${project.basedir}/../../target/</jacoco.outputDir>
</properties>

<modules>
<module>hawkbit-dmf-api</module>
<module>hawkbit-dmf-amqp</module>
Expand Down
5 changes: 0 additions & 5 deletions hawkbit-repository/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,11 @@
<name>hawkBit :: Repository</name>
<packaging>pom</packaging>

<properties>
<jacoco.outputDir>${project.basedir}/../../target/</jacoco.outputDir>
</properties>

<modules>
<module>hawkbit-repository-jpa</module>
<module>hawkbit-repository-api</module>
<module>hawkbit-repository-test</module>
<module>hawkbit-repository-core</module>
</modules>


</project>
4 changes: 0 additions & 4 deletions hawkbit-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
<artifactId>hawkbit-rest-parent</artifactId>
<name>hawkBit :: REST</name>
<packaging>pom</packaging>

<properties>
<jacoco.outputDir>${project.basedir}/../../target/</jacoco.outputDir>
</properties>

<modules>
<module>hawkbit-rest-core</module>
Expand Down
139 changes: 136 additions & 3 deletions hawkbit-test-report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
http://www.eclipse.org/legal/epl-v10.html
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.hawkbit</groupId>
Expand All @@ -17,7 +18,138 @@
</parent>
<artifactId>hawkbit-test-report</artifactId>
<name>hawkBit :: Test Report</name>


<dependencies>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-security-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-security-integration</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-http-security</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-repository-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-repository-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-repository-jpa</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-repository-test</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-artifact-repository-filesystem</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-autoconfigure</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-ui</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-ddi-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-ddi-resource</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-mgmt-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-mgmt-resource</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-rest-docs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-dmf-amqp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-dmf-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-dmf-rabbitmq-test</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-update-server</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<build>
<plugins>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>aggregate-reports</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
<configuration>
<outputDirectory>${jacoco.outputDir}/jacoco-aggregate</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

<profiles>
<profile>
<id>generateTestReport</id>
Expand Down Expand Up @@ -77,4 +209,5 @@
</build>
</profile>
</profiles>
</project>

</project>
33 changes: 18 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
Expand Down Expand Up @@ -187,13 +187,19 @@
<sonar.github.repository>eclipse/hawkbit</sonar.github.repository>
<sonar.links.homepage>https://www.eclipse.org/hawkbit</sonar.links.homepage>
<sonar.links.ci>https://circleci.com/gh/eclipse/hawkbit</sonar.links.ci>
<sonar.exclusions>**/target/generated-sources/apt/**,**/src/test/**,**/src/main/java/org/eclipse/hawkbit/repository/test/**</sonar.exclusions>
<sonar.coverage.exclusions>**/src/main/java/org/eclipse/hawkbit/ui/**,**/target/generated-sources/apt/**,**/src/main/java/org/eclipse/hawkbit/repository/test/**,**/examples/**</sonar.coverage.exclusions>
<jacoco.version>0.8.2</jacoco.version>
<jacoco.outputDir>${project.basedir}/../target/</jacoco.outputDir>
<jacoco.reportPath>${jacoco.outputDir}/jacoco-ut.exec</jacoco.reportPath>
<jacoco.itReportPath>${jacoco.outputDir}/jacoco-it.exec</jacoco.itReportPath>
<sonar.jacoco.reportPaths>${jacoco.reportPath},${jacoco.itReportPath}</sonar.jacoco.reportPaths>
<sonar.exclusions>
**/target/generated-sources/apt/**,**/src/test/**,**/src/main/java/org/eclipse/hawkbit/repository/test/**
</sonar.exclusions>
<sonar.coverage.exclusions>
**/src/main/java/org/eclipse/hawkbit/ui/**,**/target/generated-sources/apt/**,**/src/main/java/org/eclipse/hawkbit/repository/test/**,**/examples/**
</sonar.coverage.exclusions>
<jacoco.version>0.8.4</jacoco.version>
<jacoco.outputDir>${project.build.directory}</jacoco.outputDir>
<sonar.coverage.jacoco.xmlReportPaths>
${project.basedir}/../hawkbit-test-report/target/jacoco-aggregate/jacoco.xml,
${project.basedir}/../../hawkbit-test-report/target/jacoco-aggregate/jacoco.xml
</sonar.coverage.jacoco.xmlReportPaths>

<!-- Sonar - END -->

<!-- ************************ -->
Expand Down Expand Up @@ -260,6 +266,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>prepare-ut-agent</id>
Expand All @@ -268,21 +275,17 @@
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${jacoco.reportPath}</destFile>
<propertyName>jacoco.agent.ut.arg</propertyName>
<append>true</append>
</configuration>
</execution>
<execution>
<id>prepare-it-agent</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
<goal>prepare-agent-integration</goal>
</goals>
<configuration>
<destFile>${jacoco.itReportPath}</destFile>
<propertyName>jacoco.agent.it.arg</propertyName>
<append>true</append>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -384,7 +387,7 @@
</goals>
</pluginExecutionFilter>
<action>
<ignore />
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>
Expand Down

0 comments on commit af2ea84

Please sign in to comment.