0

In my JHipster service (single module project) I`m generating separate jacoco.xml for my unit tests suite and separate jacoco-it.xml report for integration tests.

I have tried to use report-aggreagate goal, but it was producing XML w/o any valuable data

plugin config:

                <plugin>
                    <groupId>org.jacoco</groupId>
                    <artifactId>jacoco-maven-plugin</artifactId>
                    <version>${jacoco-maven-plugin.version}</version>
                    <executions>
                        <execution>
                            <id>pre-unit-tests</id>
                            <goals>
                                <goal>prepare-agent</goal>
                            </goals>
                        </execution>
                        <!-- Ensures that the code coverage report for unit tests is created after unit tests have been run -->
                        <execution>
                            <id>post-unit-test</id>
                            <phase>test</phase>
                            <goals>
                                <goal>report</goal>
                            </goals>
                        </execution>
                        <execution>
                            <id>pre-integration-tests</id>
                            <goals>
                                <goal>prepare-agent-integration</goal>
                            </goals>
                        </execution>
                        <!-- Ensures that the code coverage report for integration tests is created after integration tests have been run -->
                        <execution>
                            <id>post-integration-tests</id>
                            <phase>post-integration-test</phase>
                            <goals>
                                <goal>report-integration</goal>
                            </goals>
                        </execution>
                        <!-- Merge unit and IT tests reports-->
                        <execution>
                            <id>merger-results</id>
                            <phase>verify</phase>
                            <goals>
                                <goal>report-aggregate</goal>
                            </goals>
                            <configuration>
                                <includeCurrentProject>true</includeCurrentProject>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

aggregated report example:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><!DOCTYPE report PUBLIC "-//JACOCO//DTD Report 1.1//EN"
    "report.dtd">
<report name="servicve">
    <sessioninfo id="PC-b2895496" start="1667148896078" dump="1667148947953"/>
    <sessioninfo id="PC-fa572e49" start="1667148951912" dump="1667149124611"/>
</report>

Is there any way to merge them into one report to see the combined test coverage report?

P.S. I know how to merge multiple .exec reports, but github actions require XML format.

Artyom
  • 25
  • 5

0 Answers0