Skip to content

chore: add JaCoCo coverage reporting for SonarCloud#24518

Open
mshabarov wants to merge 2 commits into
mainfrom
jacoco-plugin
Open

chore: add JaCoCo coverage reporting for SonarCloud#24518
mshabarov wants to merge 2 commits into
mainfrom
jacoco-plugin

Conversation

@mshabarov

Copy link
Copy Markdown
Contributor

Wire the jacoco-maven-plugin into the parent pom so unit tests produce per-module target/site/jacoco/jacoco.xml reports that the Sonar scanner reads automatically. The prepare-agent goal injects the coverage agent via the existing ${surefire.argLine} placeholder; the report goal writes the XML during the test phase.

vaadin-dev-server previously set surefire.argLine statically for --add-opens, which JaCoCo now owns, so it appends the flag after ${surefire.argLine} to preserve instrumentation.

The Sonar PR workflow ran with -DskipTests and produced no coverage; it now runs unit tests, skips integration tests (-DskipITs), and excludes the flow-tests module (sonar.skip=true, needs a browser/TestBench license).

Wire the jacoco-maven-plugin into the parent pom so unit tests produce
per-module target/site/jacoco/jacoco.xml reports that the Sonar scanner
reads automatically. The prepare-agent goal injects the coverage agent via
the existing ${surefire.argLine} placeholder; the report goal writes the
XML during the test phase.

vaadin-dev-server previously set surefire.argLine statically for
--add-opens, which JaCoCo now owns, so it appends the flag after
${surefire.argLine} to preserve instrumentation.

The Sonar PR workflow ran with -DskipTests and produced no coverage; it now
runs unit tests, skips integration tests (-DskipITs), and excludes the
flow-tests module (sonar.skip=true, needs a browser/TestBench license).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the +0.0.1 label Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Test Results

 1 434 files  ±0   1 434 suites  ±0   1h 25m 29s ⏱️ + 3m 34s
10 092 tests ±0  10 024 ✅ ±0  68 💤 ±0  0 ❌ ±0 
10 564 runs  ±0  10 495 ✅ ±0  69 💤 ±0  0 ❌ ±0 

Results for commit f5bcf31. ± Comparison against base commit 5825ba6.

♻️ This comment has been updated with latest results.

@sonarqubecloud

sonarqubecloud Bot commented Jun 8, 2026

Copy link
Copy Markdown

@mshabarov mshabarov requested a review from heruan June 8, 2026 11:49

@Artur- Artur- left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this run unit tests twice for no reason? Why not include sonar in the unit test build instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants