I am working on a spring-boot webservice using maven and the
spring-boot-maven-plugin. As usual, unit and integration tests are executed
separately.
For integration tests I use the spring-boot-maven-plugin where I run
'start' in the phase 'pre-integration-test' to start the spring boot
application and then 'stop' in the pase 'post-integration-test' to shut it
down again.
There is no issue with the unit tests, however when running integration
tests, the coverage from tests sending requests to the running webservice
application is not recorded. I don't see any error message.
My pom.xml contains these relevant sections:
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<excludes>
<exclude>com/mycompany/generated/**/*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>jacoco-initialize-ut</id>
<phase>initialize</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-initialize-it</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent-integration</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>verify</phase>
<goals>
<goal>report</goal>
<goal>report-integration</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${springboot.version}</version>
<executions>
<execution>
<id>pre-integration-test</id>
<goals>
<goal>start</goal>
</goals>
<configuration>
<arguments>
<argument>--integration-test</argument>
</arguments>
<maxAttempts>3</maxAttempts>
<wait>10000</wait>
<fork>true</fork>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<groups>${integrationTestGroups}</groups>
<includes>
<include>**/*.java</include>
</includes>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
As seen here I am sticking pretty much to the defaults.
Any idea what I am doing wrong?
--
You received this message because you are subscribed to the Google Groups
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jacoco/dd80264f-8604-4bf0-a985-8e73077ca4d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.