Skip to content

CAMEL-23274: Add incremental coverage to SonarCloud PR analysis#22469

Draft
gnodet wants to merge 1 commit intoapache:ci-merge-incremental-build-detect-dependenciesfrom
gnodet:sonar-coverage-incremental
Draft

CAMEL-23274: Add incremental coverage to SonarCloud PR analysis#22469
gnodet wants to merge 1 commit intoapache:ci-merge-incremental-build-detect-dependenciesfrom
gnodet:sonar-coverage-incremental

Conversation

@gnodet
Copy link
Copy Markdown
Contributor

@gnodet gnodet commented Apr 7, 2026

CAMEL-23274

Summary

Follow-up to #22468 (core coverage) and #22247 (incremental build rationalization).

  • Add per-module JaCoCo coverage for PR-affected components by reusing the incremental-build action with -Dcoverage
  • Add jacoco:report goal to the coverage profile in parent/pom.xml so each tested module generates its own XML report
  • Update sonar.coverage.jacoco.xmlReportPaths to include both per-module and aggregated report paths

Coverage strategy

Scope Approach Report path
Core modules Aggregated report via coverage module (camel-core tests exercise classes across camel-core-model, camel-core-processor, etc.) coverage/target/site/jacoco-aggregate/jacoco.xml
Components Per-module reports (each component's tests cover its own classes) */target/site/jacoco/jacoco.xml

Dependencies

Test plan

  • Verify per-module JaCoCo reports are generated for tested components
  • Verify SonarCloud picks up both aggregated and per-module coverage data
  • Verify incremental-build works with -Dcoverage in MVND_OPTS

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using build-all, build-dependents, skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

Build on top of the core coverage baseline by adding per-module
coverage for PR-affected components using the incremental-build action.

Changes:
- parent/pom.xml: Add jacoco:report goal to coverage profile so each
  tested module generates its own XML report
- pom.xml: Update sonar.coverage.jacoco.xmlReportPaths to include
  both per-module and aggregated report paths
- sonar-build.yml: Add incremental-build step with -Dcoverage in
  MVND_OPTS to test PR-affected modules with JaCoCo

Coverage strategy:
- Core: aggregated report via coverage module (camel-core tests
  exercise classes across multiple core source modules)
- Components: per-module reports (each component's tests cover
  its own classes)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant