Skip to content

Commit 97a7cb0

Browse files
dfa1claude
andcommitted
ci: aggregate JaCoCo coverage across modules for Sonar
Integration tests live in vortex-integration but exercise classes in reader/writer/core. JaCoCo's report-integration only covers classes in the current module → empty report → Sonar shows 1% coverage for BitpackedEncodingDecoder etc. Fix: use report-aggregate in the integration module to merge jacoco-it.exec data with reader/writer/core class directories. report-aggregate skips test-scope dependencies by default, so the coverage profile promotes vortex-core/reader/writer/inspector to compile scope (safe — integration module is never published). sonar.coverage.jacoco.xmlReportPaths now points at the aggregate report instead of integration's per-module jacoco-it.xml. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 22887cb commit 97a7cb0

2 files changed

Lines changed: 64 additions & 5 deletions

File tree

integration/pom.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,62 @@
9191
</dependency>
9292
</dependencies>
9393

94+
<profiles>
95+
<profile>
96+
<id>coverage</id>
97+
<!-- When reporting coverage, promote key modules from test to compile scope so
98+
jacoco:report-aggregate can locate their class directories. The integration
99+
module is never published (maven.deploy.skip=true) so this has no downstream
100+
impact. -->
101+
<dependencies>
102+
<dependency>
103+
<groupId>io.github.dfa1.vortex</groupId>
104+
<artifactId>vortex-core</artifactId>
105+
<scope>compile</scope>
106+
</dependency>
107+
<dependency>
108+
<groupId>io.github.dfa1.vortex</groupId>
109+
<artifactId>vortex-reader</artifactId>
110+
<scope>compile</scope>
111+
</dependency>
112+
<dependency>
113+
<groupId>io.github.dfa1.vortex</groupId>
114+
<artifactId>vortex-writer</artifactId>
115+
<scope>compile</scope>
116+
</dependency>
117+
<dependency>
118+
<groupId>io.github.dfa1.vortex</groupId>
119+
<artifactId>vortex-inspector</artifactId>
120+
<scope>compile</scope>
121+
</dependency>
122+
</dependencies>
123+
<build>
124+
<plugins>
125+
<plugin>
126+
<groupId>org.jacoco</groupId>
127+
<artifactId>jacoco-maven-plugin</artifactId>
128+
<executions>
129+
<!-- Aggregate integration-test coverage across all dependency modules.
130+
report-integration only covers classes in THIS module (none), so
131+
we use report-aggregate to collect reader/writer/core class hits
132+
from the jacoco-it.exec files that failsafe produces here. -->
133+
<execution>
134+
<id>report-aggregate-it</id>
135+
<phase>verify</phase>
136+
<goals>
137+
<goal>report-aggregate</goal>
138+
</goals>
139+
<configuration>
140+
<outputDirectory>${project.reporting.outputDirectory}/jacoco-aggregate</outputDirectory>
141+
</configuration>
142+
</execution>
143+
</executions>
144+
</plugin>
145+
</plugins>
146+
</build>
147+
</profile>
148+
</profiles>
149+
94150
<build>
95151
<plugins>
96152
<plugin>

pom.xml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,17 @@
8484
**/fbs/**,
8585
**/proto/**
8686
</sonar.coverage.exclusions>
87-
<!-- Coverage sources: per-module surefire, per-module failsafe, and the
88-
integration-module failsafe report. Integration tests live in the
89-
vortex-integration module and exercise classes in reader/writer/core —
90-
without the third path those cross-module hits are invisible to Sonar. -->
87+
<!-- Coverage sources:
88+
1. per-module surefire (unit tests)
89+
2. per-module failsafe (module-local integration tests)
90+
3. integration-module aggregate — report-aggregate in the integration
91+
module reads **/jacoco-it.exec from all dependency modules and reports
92+
on all their classes, giving Sonar coverage for BitpackedEncodingDecoder
93+
etc. that are exercised by cross-module integration tests. -->
9194
<sonar.coverage.jacoco.xmlReportPaths>
9295
${project.build.directory}/site/jacoco/jacoco.xml,
9396
${project.build.directory}/site/jacoco-it/jacoco.xml,
94-
${maven.multiModuleProjectDirectory}/integration/target/site/jacoco-it/jacoco.xml
97+
${maven.multiModuleProjectDirectory}/integration/target/site/jacoco-aggregate/jacoco.xml
9598
</sonar.coverage.jacoco.xmlReportPaths>
9699
<!-- Default for the {@code @{argLine}} placeholder in surefire/failsafe configs. JaCoCo's
97100
{@code prepare-agent} goal overwrites this with the agent arguments when active; if

0 commit comments

Comments
 (0)