Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ELY-2480] Add code coverage to the project #1941

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ 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 -Ptest-coverage clean org.openclover:clover-maven-plugin:setup install 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/).


Expand Down
33 changes: 33 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
<version.org.keycloak.keycloak-services>23.0.7</version.org.keycloak.keycloak-services>
<version.org.aesh>2.7</version.org.aesh>
<version.org.xnio>3.8.16.Final</version.org.xnio>
<version.org.openclover>4.5.2</version.org.openclover>

<test.level>INFO</test.level>
<!-- Checkstyle configuration -->
Expand Down Expand Up @@ -1086,6 +1087,14 @@
</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>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
Expand Down Expand Up @@ -1472,6 +1481,30 @@
</plugins>
</build>
</profile>
<profile>
<!--To generate a report on test coverage run
mvn -Ptest-coverage clean org.openclover:clover-maven-plugin:setup install org.openclover:clover-maven-plugin:aggregate org.openclover:clover-maven-plugin:clover
-->
<id>test-coverage</id>
<build>
<plugins>
<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>
</profiles>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ boolean hasNext() {
}
cp = i.next();
if (! isNameChar(cp)) {
switch (nextStringVal = string.substring((int) start, (int) i.getIndex() - 1)) {}
nextStringVal = string.substring((int) start, (int) i.getIndex() - 1);
i.previous();
this.offs = offs;
next = TOK_NAME;
Expand Down
Loading