You're right, I need to give you more details.
In fact, I'm launching Integration Tests from a pipeline:
- These tests are Implemented with RestAssured
- and RestAssured uses a JBoss server (installed in a docker).
My pipeline uses maven and the failsafe plugin to run the IT tests.
- part of my pom file:
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
<id>integration-tests</id>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<includes>
<include>**/*IT.java</include>
</includes>
<skipTests>false</skipTests>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${version.jacoco}</version>
<executions>
<execution>
<id>agent-for-it</id>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>report-it</id>
<phase>verify</phase>
<goals>
<goal>report-integration</goal>
</goals>
</execution>
</executions>
</plugin>
The Jacoco agent is attached on the Jboss JVM.
see: ps -aef result:
/opt/java/bin/java -D[Standalone] -XX:+UseCompressedOops -verbose:gc -Xloggc:/home/jboss/log/gc.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=3M -XX:-TraceClassUnloading
-server -Djava.net.preferIPv4Stack=true -XX:MaxRAMFraction=2 -Djava.awt.headless=true -javaagent:./opt/jboss-eap/jacocoagent.jar=destfile=/home/jacoco.exec
-Dorg.jboss.boot.log.file=/home/jboss/log/server.log -Dlogging.configuration=file:/opt/jboss-eap/standalone/configuration/logging.properties -jar /opt/jboss-eap/jboss-modules.jar
-mp /opt/jboss-eap/modules -jaxpmodule javax.xml.jaxp-provider org.jboss.as.standalone
-Djboss.home.dir=/opt/jboss-eap -Djboss.server.base.dir=/opt/jboss-eap/standalone -Djboss.server.log.dir=/home/jboss/log/ -Djboss.server.temp.dir=/tmp -b 0.0.0.0 -bmanagement 0.0.0.0 -Ddocker.jboss.log.level=INFO
My application is deployed and all tests are success.
But the coverage remains at 0%, and when I check the session view, I don't see my classes.
If, for Marc and you, it's due to the fact the agent is not in the right JVM, to be honest I dont know where to put it :(
I'm sure I'm missing something, because your example is clear and work fine.