gnodet opened a new pull request, #22468:
URL: https://github.com/apache/camel/pull/22468

   [CAMEL-23274](https://issues.apache.org/jira/browse/CAMEL-23274)
   
   ## Summary
   
   - The SonarCloud PR analysis always reported 0% coverage because 
`sonar-build.yml` built with `-Dquickly` (skipping all tests) and never 
activated the `-Dcoverage` profile
   - Add a Maven step in `sonar-build.yml` that runs core module tests with 
`-Dcoverage` and generates the aggregated JaCoCo report via the `coverage` 
module
   - All core source modules are included in the reactor so `report-aggregate` 
can map execution data from `camel-core` tests to their classes (~2452 classes 
across 13 modules)
   - Add `ContextValueFactory` to JaCoCo multi-release JAR excludes in 
`coverage/pom.xml` (same issue as existing `CamelThreadFactory` exclude)
   
   ## Details
   
   The infrastructure for coverage was already in place:
   - `parent/pom.xml`: JaCoCo `prepare-agent` configured in surefire/failsafe 
(activated by `-Dcoverage`)
   - `coverage/pom.xml`: `report-aggregate` goal collects execution data across 
modules (activated by `-Dcoverage`)
   - Root `pom.xml`: `sonar.coverage.jacoco.xmlReportPaths` points to the 
aggregated report
   
   The only missing piece was actually running tests with `-Dcoverage` in the 
sonar build workflow.
   
   Currently scoped to core modules only. Component coverage will be added as a 
follow-up once #22247 lands, by reusing `incremental-build.sh` module detection.
   
   ## Test plan
   
   - [x] Tested locally: produces a 12 MB aggregated report with ~63% line 
coverage across 2452 classes in 13 core modules
   - [ ] Verify SonarCloud picks up the coverage data on this PR's analysis


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to