Skip to content

ci: add SonarCloud analysis with JaCoCo coverage - #253

Merged
shossain786 merged 1 commit into
masterfrom
ci/sonarcloud
Nov 14, 2026
Merged

shossain786 merged 1 commit into
masterfrom
ci/sonarcloud

Conversation

@shossain786

Copy link
Copy Markdown
Contributor

Adds SonarCloud, as agreed in #251.

Changes

  • jacoco-maven-plugin 0.8.13 writes target/site/jacoco/jacoco.xml during mvn test.
  • Surefire argLine is now @{argLine} ... so the JaCoCo agent attaches. An empty default keeps -Djacoco.skip=true working.
  • sonar.* properties in the pom: organization seleniumboot, project key seleniumboot_selenium-boot.
  • New .github/workflows/sonar.yml runs on master pushes and PRs. If SONAR_TOKEN is missing (fork PRs, or before setup) it skips instead of failing.

Verified locally

  • mvn verify -Dgpg.skip=true: 896 tests, 0 failures. jacoco.xml written, 57.9% line coverage.
  • -Djacoco.skip=true build still passes.
  • Workflow YAML parses.

Not verified: the Sonar scan itself. It needs the SonarCloud project and token first:

  1. sonarcloud.io → import the seleniumboot GitHub org → add selenium-boot. Check that the org/project keys match the pom.
  2. In SonarCloud, turn off Automatic Analysis (it conflicts with CI analysis).
  3. Add the SONAR_TOKEN repo secret.

🤖 Generated with Claude Code

- jacoco-maven-plugin writes target/site/jacoco/jacoco.xml during mvn test
- surefire argLine now carries @{argLine} so the JaCoCo agent attaches
- sonar.* properties in the pom (org seleniumboot, key seleniumboot_selenium-boot)
- new sonar.yml workflow; skips cleanly when SONAR_TOKEN is absent (forks)

Agreed in #251.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@shossain786
shossain786 merged commit 2a07bba into master Nov 14, 2026
5 checks passed
@shossain786
shossain786 deleted the ci/sonarcloud branch November 14, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant