mardi 2 juin 2020

JaCoCo and multiple JVM coverage

I'm pretty new to maven and jacoco, I need to detect the real coverage of the app and make a report I've managed to do but partially, I explain.

In my project we use Geode and we pull a library to raise an embedded geode at the time of doing this, it is injected/passed some classes that the app requires.

Then, in the app at the time of doing the tests we only need to use the utils class and then call the geode because those classes are already loaded.

The problem is that at the time of the report jacoco only detects a 4% coverage because it represents the useful classes that I use in the test but can not or rather, I do not know how to make it also perform the coverage of the classes that I inject into the geode at the time of lifting.

How are two JVMs running at the same time I don't know if what I need to do is possible?

I annexed what I was able to do in the MAVEN to detect the coverage.

Thanks a lot!

    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                        <version>${jacoco.version}</version>
                        <executions>
                            <execution>
                                <id>default-prepare-agent</id>
                                <goals>
                                    <goal>prepare-agent</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>default-report</id>
                                <goals>
                                    <goal>report</goal>
                                </goals>
                            </execution>
                            <execution>
                                <id>jacoco-check</id>
                                <phase>test</phase>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                                <configuration>
                                    <rules>
                                        <rule>
                                            <element>BUNDLE</element>
                                            <limits>
                                                <limit>
                                                    <counter>LINE</counter>
                                                    <value>COVEREDRATIO</value>
                                                    <minimum>4%</minimum>
                                                </limit>
                                            </limits>
                                        </rule>
                                    </rules>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>

Aucun commentaire:

Enregistrer un commentaire