Veilchen4ever
Veilchen4ever

Reputation: 399

Integrationtest-Coverage of an Quarkusapplication with Jacoco and Cucumber shows 0% Coverage

Since two days I am struggling with this issue. I have 4 Microservices all running with Quarkus (for now they are all running with differenct ports on localhost). In a local Maven Module I run Cucumber-Integrationtests (class is called CucumberIT.java) with mvn verify. The test pass successfully.

I think my configuration in the pom.xml is exactly what is mentioned in the quarkus-documentation here Coverage for Integration Tests This is my pom.xml showing the configuration of jacoco-maven-plugin and the maven-failsafe-plugin.

        <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>${version.jacoco}</version>
            <executions>
                <execution>
                    <id>prepare-unit-test-agent</id>
                    <goals>
                        <goal>prepare-agent</goal>
                    </goals>
                    <configuration>
                        <propertyName>surefireArgLine</propertyName>
                        <destFile>${project.build.directory}/jacoco-ut.exec</destFile>
                    </configuration>
                </execution>
                <execution>
                    <id>prepare-integration-test-agent</id>
                    <goals>
                        <goal>prepare-agent-integration</goal>
                    </goals>
                    <configuration>
                        <destFile>${project.build.directory}/jacoco-it.exec</destFile>
                        <append>true</append>
                    </configuration>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-failsafe-plugin</artifactId>
            <version>3.5.2</version>
            <executions>
                <execution>
                    <goals>
                        <goal>integration-test</goal>
                        <goal>verify</goal>
                    </goals>
                    <configuration>
                        <systemPropertyVariables>
                            <java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
                            <maven.home>${maven.home}</maven.home>
                            <quarkus.test.arg-line>${argLine}</quarkus.test.arg-line>
                            <reportsDirectory>${project.build.directory}/failsafe-reports</reportsDirectory>                    <native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
                        </systemPropertyVariables>
                    </configuration>
                </execution>
            </executions>
        </plugin>

In all my application.properties I added quarkus.package.write-transformed-bytecode-to-build-output=true since this reported by the quarkus-documentation as a requirement. The jacoco-it.exec is generated but when I open it with Intellij the coverage is 0%. Is my configuration wrong? I use as suggested <quarkus.test.arg-line>${argLine}</quarkus.test.arg-line> although argLine is not declared as a property in my pom.xml - is this correct?

Upvotes: 0

Views: 41

Answers (0)

Related Questions