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

Add profile for coverage reports with JaCoCo #283

Open
kwin opened this issue Dec 20, 2024 · 1 comment · May be fixed by #284
Open

Add profile for coverage reports with JaCoCo #283

kwin opened this issue Dec 20, 2024 · 1 comment · May be fixed by #284

Comments

@kwin
Copy link
Member

kwin commented Dec 20, 2024

The defacto standard for code coverage calculation with Maven/Java is JaCoCo. A profile should be provided in the ASF parent which collects coverage data for both UTs/ITs and creates reports as outlined in https://www.eclemma.org/jacoco/trunk/doc/examples/build/pom-it.xml.
Those reports should be usable also for https://docs.sonarsource.com/sonarqube-server/10.7/analyzing-source-code/test-coverage/java-test-coverage/ (i.e. be emitted with default filenames) or https://github.com/codecov/example-java-maven

Default locations for sonar.coverage.jacoco.xmlReportPaths (can be overridden) are

  1. target/site/jacoco/jacoco.xml
  2. target/site/jacoco-it/jacoco.xml
  3. build/reports/jacoco/test/jacocoTestReport.xml

TODO: Check if SonarQube supports separate reports for ITs and UTs or requires them in merged format.

@kwin kwin changed the title Add profile for Coverage reports with JaCoCo Add profile for coverage reports with JaCoCo Dec 20, 2024
@kwin
Copy link
Member Author

kwin commented Dec 21, 2024

Also note jacoco/jacoco#1676.

kwin added a commit that referenced this issue Dec 21, 2024
Add dedicated profile "coverage" to generate separate reports for both
UTs and ITs.

This closes #283
@kwin kwin linked a pull request Dec 21, 2024 that will close this issue
kwin added a commit that referenced this issue Dec 21, 2024
Add dedicated profile "coverage" to generate separate reports for both
UTs and ITs.

This closes #283
kwin added a commit that referenced this issue Dec 21, 2024
Add dedicated profile "coverage" to generate separate reports for both
UTs and ITs.

This closes #283
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant