This is an automated email from the ASF dual-hosted git repository.
apupier pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/main by this push:
new 947fc406edf5 CAMEL-27163: Only instrument org.apache.camel classes
with the JaCoCo agent in the coverage profile
947fc406edf5 is described below
commit 947fc406edf5e24eee1c65530e6cae1b43dc159d
Author: Aurélien Pupier <[email protected]>
AuthorDate: Wed Nov 18 14:13:04 2026 +0100
CAMEL-27163: Only instrument org.apache.camel classes with the JaCoCo agent
in the coverage profile
The prepare-agent execution of the coverage profile in parent/pom.xml had
no includes, so the JaCoCo agent instrumented every class loaded by the
forked test JVMs: Camel, but also all the third party libraries and the
test dependencies. This adds CPU and memory overhead to the tests for no
benefit, as the coverage reported to Sonar only concerns Camel classes.
Add an includes of org/apache/camel/** to the agent configuration. All the
main sources measured by Sonar are in this package (the coverage report is
only used for the main sources; the com.acme class in the camel-jbang-core
test resources is only an example). The existing CamelThreadFactory
exclusion is kept.
Measured on the same machine with the exact Jenkinsfile command for the
ubuntu-avx jdk 21 build (-T1C -Pcoverage, surefire reruns, -fae), with and
without the change, on the part of the build that completed in both runs
(the build without the change was stopped by an out of memory at module
646 of 729, the build with the change completed in 37 min):
- sum of the test time of the 11,866 test classes run in both builds:
49,685 s before, 41,942 s after (-16%)
- sum for the 237 modules with more than 30 s of test time:
46,661 s before, 39,562 s after (-15%), median per module ratio 0.85
- the size of the jacoco.exec file of camel-netty goes from 241 KB to
94 KB.
Co-authored-by: IBM Bob 2.2.1
Signed-off-by: Aurélien Pupier <[email protected]>
---
parent/pom.xml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/parent/pom.xml b/parent/pom.xml
index 73b0edc823e0..714a0116c07e 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -4660,6 +4660,10 @@
</goals>
<configuration>
<propertyName>jacocoAgent</propertyName>
+ <!-- Only instrument Camel classes:
instrumenting third party libraries slows down the tests for no coverage value
-->
+ <includes>
+ <include>org/apache/camel/**</include>
+ </includes>
<!-- Workaround to multi-release jar
https://github.com/jacoco/jacoco/issues/407 -->
<excludes>
<exclude>**/CamelThreadFactory*</exclude>