Switch Jacoco's code coverage format to XML reports (#882)

* 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 <natalia.kislicyn@bosch-si.com>

* add update-server dependency to test report

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch-si.com>

* Reorder elements in pom

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch-si.com>

* undo surefire / failsafe changes

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch-si.com>

* set remote sonar host

Signed-off-by: Natalia Kislicyn <natalia.kislicyn@bosch-si.com>
This commit is contained in:
Natalia Kislicyn
2019-11-08 15:41:18 +01:00
committed by Dominic Schabel
parent 51982a77e3
commit c0ed1cdfbe
5 changed files with 154 additions and 31 deletions

View File

@@ -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>

View File

@@ -20,10 +20,6 @@
<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>
@@ -31,5 +27,4 @@
<module>hawkbit-repository-core</module>
</modules>
</project>

View File

@@ -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>

View File

@@ -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>
@@ -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>
@@ -77,4 +209,5 @@
</build>
</profile>
</profiles>
</project>
</project>

33
pom.xml
View File

@@ -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>
@@ -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 -->
<!-- ************************ -->
@@ -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>
@@ -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>
@@ -384,7 +387,7 @@
</goals>
</pluginExecutionFilter>
<action>
<ignore />
<ignore/>
</action>
</pluginExecution>
</pluginExecutions>