apupier opened a new pull request, #30387: URL: https://github.com/apache/camel/pull/30387
JIRA: https://issues.apache.org/jira/browse/CAMEL-27163 ## Problem The Sonar analysis of the Jenkins build (ubuntu-avx, jdk21) takes about 54 minutes. 1,219 s (about 20 min) of it are spent in the `JaCoCo XML Report Importer` sensor: the root pom sets `sonar.coverage.jacoco.xmlReportPaths` to the single aggregated report of the `coverage` module (about 110 MB), and each of the 729 modules parses it again. ## Change Generate a small report per module instead. The report of a module cannot be built from its own `jacoco.exec` only, because some modules are covered by the tests of other modules (for example `camel-support`: 991 lines covered by its own tests, 17,797 with the data of all the modules), so the reports are built from the execution data of all the modules merged in one file. - root `pom.xml`: new `coverage` profile with a `merge-all` execution (not bound to a phase), run on the root project once the modules are built. `sonar.coverage.jacoco.xmlReportPaths` now points to the report of each module. - `parent/pom.xml`: `report-module` execution in the `coverage` profile, not bound to a phase, with the same excludes as the aggregate report (https://github.com/jacoco/jacoco/issues/407). - `Jenkinsfile`: run the merge and the per-module reports before the Sonar analysis. - Remove the `coverage` module: it only existed to aggregate the report and lists 502 artifacts, which is not all the modules (it misses for example `camel-jbang-plugin-tui` and `camel-chaos`). `sonar-build.yml` (currently disabled) and `incremental-build.sh` are adapted. ## Test Full local build with the exact Jenkinsfile coverage command (`-Pcoverage`, 38:23, `BUILD SUCCESS`) from a clean working tree, then the Jenkinsfile Sonar command against a local SonarQube 26.11 community instance: | | complete aggregate report | per-module reports | |---|---|---| | JaCoCo importer (sum of the 729 modules) | 556 s | 1.8 s | | analysis total time | 16:54 | 8:00 | | bugs / code smells / vulnerabilities | 746 / 513 / 68 | 746 / 513 / 68 | | coverage | 56.6% | 69.9% | - The merge takes 8 s and the 609 per-module reports 60 s. - The issue counts and the lines to cover are identical, only the coverage import changes. - The coverage is higher because the aggregate only covers the modules listed in the `coverage` pom. - On CI the importer took 1,219 s, so the gain there should be larger than measured locally. Not tested: the `sonar-build.yml` workflow, as it cannot be run locally (it is disabled currently, INFRA-27808). --- _AI-generated by IBM Bob 2.2.1 on behalf of Aurélien Pupier (@apupier)._ -- 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]
