Skip to content

ci: add unit test coverage to Sonar analysis#24622

Draft
Artur- wants to merge 2 commits into
mainfrom
move-sonar
Draft

ci: add unit test coverage to Sonar analysis#24622
Artur- wants to merge 2 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.

Artur- added 2 commits June 12, 2026 19:17
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.
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Test Results

 1 440 files   -   9   1 440 suites   - 9   1h 27m 51s ⏱️ + 4m 51s
10 126 tests  - 101  10 058 ✅  - 101  68 💤 ±0  0 ❌ ±0 
10 598 runs   - 101  10 529 ✅  - 101  69 💤 ±0  0 ❌ ±0 

Results for commit c7e63d8. ± Comparison against base commit 201cbb8.

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