Skip to content

Commit

Permalink
Issue eclipse-ee4j#23507 Added jacoco and jacoco-merge profiles
Browse files Browse the repository at this point in the history
- first is used to extend surefire/failsafe plugins and collect information
  about the test coverage. Results can be imported to Eclipse.
- second is used to collect results from all subdirectories and merge them
  to one file. This can be used to view which code is not invoked by any test
  in the build.
  • Loading branch information
dmatej committed Aug 1, 2021
1 parent e1ea3de commit 787309b
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 3 deletions.
65 changes: 63 additions & 2 deletions nucleus/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,20 @@
<javaee.version.new>9</javaee.version.new>
<jmockit.version>1.49</jmockit.version>
<osgi-resource-locator.version>1.0.3</osgi-resource-locator.version>

<maven.test.jvmoptions.memory.sizes>-Xss512k -Xms256m -Xmx1g -XX:MaxDirectMemorySize=512m</maven.test.jvmoptions.memory.sizes>
<maven.test.jvmoptions.memory.gc>-verbose:gc -XX:+UseG1GC -XX:+UseStringDeduplication</maven.test.jvmoptions.memory.gc>
<maven.test.jvmoptions.display>-Djava.awt.headless=true</maven.test.jvmoptions.display>
<maven.test.jvmoptions.locale>-Duser.language=en -Duser.region=US</maven.test.jvmoptions.locale>
<maven.test.jvmoptions.custom></maven.test.jvmoptions.custom>
<maven.test.jvmoptions>
${maven.test.jvmoptions.memory.sizes}
${maven.test.jvmoptions.memory.gc}
${maven.test.jvmoptions.display}
${maven.test.jvmoptions.locale}
${maven.test.jvmoptions.custom}
</maven.test.jvmoptions>
<surefire.argLine>${maven.test.jvmoptions}</surefire.argLine>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -703,9 +717,9 @@
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<version>3.0.0-M5</version>
<configuration>
<argLine>--add-opens java.base/java.lang=ALL-UNNAMED</argLine>
<argLine>${surefire.argLine}</argLine>
<useSystemClassLoader>true</useSystemClassLoader>
<forkCount>1</forkCount>
</configuration>
Expand Down Expand Up @@ -1273,6 +1287,53 @@
</plugins>
</build>
</profile>
<profile>
<id>jacoco</id>
<properties>
<checkstyle.skip>true</checkstyle.skip>
<jacoco.report.outputDirectory>${project.build.directory}/jacoco</jacoco.report.outputDirectory>
<jacoco.version>0.8.7</jacoco.version>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<surefire.argLine>${maven.test.jvmoptions} @{argLine}</surefire.argLine>
</properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<includes>
<include>org.glassfish.*</include>
</includes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>agent-for-unit-tests</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>agent-for-integration-tests</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>edit-manPages-javaEEVersion</id>
<build>
Expand Down
34 changes: 33 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,39 @@
<module>nucleus/tests</module>
</modules>
</profile>

<profile>
<id>jacoco-merge</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<id>jacoco-merge</id>
<phase>verify</phase>
<inherited>false</inherited>
<goals>
<goal>merge</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<directory>${basedir}</directory>
<includes>
<include>**/*.exec</include>
</includes>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<!--
Expand Down Expand Up @@ -118,7 +151,6 @@
</plugin>
</plugins>


<pluginManagement>
<plugins>
<plugin>
Expand Down

0 comments on commit 787309b

Please sign in to comment.