Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarkus Mutli module project Jacoco.xml only has the latest module results #42040

Open
RickVerkuijlenMentech opened this issue Jul 22, 2024 · 0 comments
Labels
area/testing kind/bug Something isn't working

Comments

@RickVerkuijlenMentech
Copy link

Describe the bug

I have a multi module project where I use Quarkus. In all the modules, I have written tests that all are succeeding. I want to see my code coverage in a self-hosted SonarQube instance. When I run ./mvnw verify, the target folder is being generated and is filled with the code coverage, all in different folders.

image

When using the jacoco.exec file in IntelliJ, I can see the fact that the code coverage does seem to work. But, since SonarQube doesn't support the binary format of Jacoco anymore, it needs to have the XML format.
Example of jacoco.exec in IntelliJ

The XML format of Jacoco seems like it only has the last module in the generated list. This is shown in the CSV file that is generated with Jacoco. During the verify command, the CSV file changes the content to the module it is currently working on and overwrite the old ones. The content of the CSV file and the XML file do match.

CSV file generated by Jacoco

Expected behavior

Within in multi-module project, the XML file is overwritten with the module that it is building on that moment. Which means, at the end of the build, the XML file only holds code coverage information about the last in the build line.

Actual behavior

An XML file that is filled with all the modules code coverage in one file. This needs to be in one file because SonarQube only accepts one XML file as its code coverage source.

How to Reproduce?

  1. Have a multi module project with tests
  2. Use the guide for multi module projects: https://quarkus.io/guides/tests-with-coverage#working-with-multi-module-projects
  3. Check the CSV/XML file and there should only be one module result.

Output of uname -a or ver

No response

Output of java -version

OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)

Quarkus version or git rev

3.12.2

Build tool (ie. output of mvnw --version or gradlew --version)

Maven home: /Users/rickverkuijlen/.m2/wrapper/dists/apache-maven-3.9.6-bin/3311e1d4/apache-maven-3.9.6 Java version: 21.0.3, vendor: Eclipse Adoptium, runtime: /Users/rickverkuijlen/.sdkman/candidates/java/21.0.3-tem Default locale: en_NL, platform encoding: UTF-8 OS name: "mac os x", version: "14.5", arch: "aarch64", family: "mac"

Additional information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants