Repository navigation
Enable JaCoCo coverage reporting for tsql-scriptdom-astgen and aggregate Sonar report discovery - #30
Conversation
Co-authored-by: fupacat <595487+fupacat@users.noreply.github.com>
tsql-scriptdom-astgen and aggregate Sonar report discovery
There was a problem hiding this comment.
🟢 Approval recommended
The build-configuration change is minimal, correctly mirrors the established JaCoCo pattern, and properly aggregates module coverage reports for Sonar.
0 open findings
What changed in this PR
This PR fixes SonarCloud reporting 0% coverage for the tsql-scriptdom-astgen module. Previously only tsql-scriptdom-core ran the JaCoCo agent, so tsql-scriptdom-astgen's tests produced no execution data. The change enables JaCoCo in tsql-scriptdom-astgen and broadens the parent Sonar report-path property to discover JaCoCo XML output from every module.
Changes:
- Added
jacoco-maven-plugintotsql-scriptdom-astgen/pom.xmlwithprepare-agentandreport(bound totest) executions, mirroringtsql-scriptdom-core. - Changed the parent
sonar.coverage.jacoco.xmlReportPathsfrom a module-local path to a recursive wildcard (${project.basedir}/**/target/site/jacoco/jacoco.xml).
| File | Description |
|---|---|
tsql-scriptdom-astgen/pom.xml |
Adds JaCoCo plugin executions so the module's tests generate coverage data; version inherited from parent pluginManagement (0.8.15). |
pom.xml |
Updates Sonar JaCoCo XML report path to a recursive wildcard so all module-level reports are discovered. |
I verified that the new tsql-scriptdom-astgen plugin block is identical to the existing tsql-scriptdom-core configuration, the JaCoCo version is managed centrally, tsql-scriptdom-astgen has tests that will now be instrumented, and the wildcard path resolves correctly at both parent and module scope (only two modules, no stray nested target directories). No objective issues were found.
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
tsql-scriptdom-astgentests were executing without JaCoCo, so SonarCloud had no execution data for that module and reported 0% coverage for its sources. This change aligns coverage generation across modules and updates Sonar report path resolution to ingest all module-level JaCoCo XML outputs.JaCoCo execution in
tsql-scriptdom-astgenjacoco-maven-plugintotsql-scriptdom-astgen/pom.xmlprepare-agentandreportexecutions (report bound totest), matching the existing pattern used bytsql-scriptdom-coreSonar JaCoCo XML path aggregation at parent level
pom.xmlproperty: