Skip to content

Commit

Permalink
[ELY-2480] Add code coverage to the project
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitris Kafetzis committed May 2, 2024
1 parent 4f2b26d commit 79d7bca
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ mvn clean install -Dtest=TestClassName
```
Note: Some tests will fail if `localhost` is not listed first in `/etc/hosts` file for the loopback addresses (IPv4 and IPv6).

To generate a report on test coverage, use:

```bash
mvn clean install -Ptest-coverage org.openclover:clover-maven-plugin:aggregate org.openclover:clover-maven-plugin:clover
```
The generated report is at `target/site/clover` and to access it start by opening `index.html` in the directory with a browser of choice.

For more information, including details on how WildFly Elytron is integrated in WildFly Core and WildFly, check out our [developer guide](https://wildfly-security.github.io/wildfly-elytron/getting-started-for-developers/).

## Contributing Guidelines
Expand Down
45 changes: 45 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<version.io.rest-assured>4.3.3</version.io.rest-assured>
<version.net.sourceforge.htmlunit.htmlunit>2.40.0</version.net.sourceforge.htmlunit.htmlunit>
<version.org.apache.santuario>2.3.0</version.org.apache.santuario>
<version.org.openclover>4.5.2</version.org.openclover>

<test.level>INFO</test.level>
<!-- Checkstyle configuration -->
Expand Down Expand Up @@ -1242,10 +1243,54 @@
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/org.openclover/clover-maven-plugin -->
<dependency>
<groupId>org.openclover</groupId>
<artifactId>clover-maven-plugin</artifactId>
<version>${version.org.openclover}</version>
</dependency>

</dependencies>
</dependencyManagement>

<profiles>
<profile>
<!--To generate a report on test coverage run
mvn clean install -Ptest-coverage org.openclover:clover-maven-plugin:aggregate org.openclover:clover-maven-plugin:clover
-->
<id>test-coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.openclover</groupId>
<artifactId>clover-maven-plugin</artifactId>
<executions>
<execution>
<id>clover-setup</id>
<phase>process-sources</phase>
<goals>
<goal>setup</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>modularizedJdk</id>
<activation>
Expand Down

0 comments on commit 79d7bca

Please sign in to comment.