Skip to content

ci: add unit test coverage to Sonar analysis and analyze branches#24622

Open
Artur- wants to merge 6 commits into
mainfrom
move-sonar
Open

ci: add unit test coverage to Sonar analysis and analyze branches#24622
Artur- wants to merge 6 commits into
mainfrom
move-sonar

Conversation

@Artur-

@Artur- Artur- commented Jun 12, 2026

Copy link
Copy Markdown
Member

Run the unit tests with a JaCoCo agent (new coverage profile) and feed the per-module XML reports to Sonar via
sonar.coverage.jacoco.xmlReportPaths. The test jobs upload the reports as artifacts and the Sonar job extracts them into the restored workspace, so the tests run only once. Reports are renamed with the matrix index since split modules (see moduleSplits in computeMatrix.js) produce partial reports for the same module in several jobs; Sonar merges the partials.

Also runs analyze when pushing to main, 25.1 etc

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown

Test Results

 1 452 files  ±0   1 452 suites  ±0   1h 25m 52s ⏱️ - 1m 24s
10 260 tests ±0  10 192 ✅ ±0  68 💤 ±0  0 ❌ ±0 
10 732 runs  ±0  10 663 ✅ ±0  69 💤 ±0  0 ❌ ±0 

Results for commit ae32b06. ± Comparison against base commit b57289a.

♻️ This comment has been updated with latest results.

@Artur- Artur- marked this pull request as ready for review June 15, 2026 15:27
@Artur- Artur- requested a review from heruan June 15, 2026 15:27
Artur- added 2 commits June 16, 2026 09:49
Run the Sonar job after the unit test matrix instead of in its own
workflow, restoring the saved-workspace artifact like the test jobs do
instead of compiling the whole project again. Running in this position
also allows the analysis to consume output from the unit test jobs,
such as coverage data.

The saved-workspace cleanup moves from test-results to a job that also
waits for the Sonar analysis; deleting it in test-results could race
with the Sonar job downloading it when the IT matrix finishes before
the unit tests.

flow-gradle-plugin is excluded from the analysis because the build job
does not compile it, so the workspace contains no classes for it.
Run the unit tests with a JaCoCo agent (new coverage profile) and feed
the per-module XML reports to Sonar via
sonar.coverage.jacoco.xmlReportPaths. The test jobs upload the reports
as artifacts and the Sonar job extracts them into the restored
workspace, so the tests run only once. Reports are renamed with the
matrix index since split modules (see moduleSplits in computeMatrix.js)
produce partial reports for the same module in several jobs; Sonar
merges the partials.

Also define an empty default for surefire.argLine: the unresolved
expression is passed literally to the forked JVM on Maven 3.9+, which
makes the fork fail to start.
@Artur- Artur- changed the title ci: add unit test coverage to Sonar analysis ci: add unit test coverage to Sonar analysis and analyze branches Jun 17, 2026
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
E Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

1 participant