Skip to content

ci: generate lcov coverage report for SonarCloud#3

Merged
guyinwonder168 merged 1 commit intomainfrom
fix/sonarcloud-coverage
Apr 3, 2026
Merged

ci: generate lcov coverage report for SonarCloud#3
guyinwonder168 merged 1 commit intomainfrom
fix/sonarcloud-coverage

Conversation

@guyinwonder168
Copy link
Copy Markdown
Owner

Summary

  • Add vitest.config.ts with @vitest/coverage-v8 reporter set to text + lcov so coverage/lcov.info is generated
  • Update CI workflow to run npx vitest run --coverage before SonarCloud scan
  • Point sonar.javascript.lcov.reportPaths to coverage/lcov.info in sonar-project.properties

Without this, SonarCloud shows 0% coverage because v8 defaults to clover/json/html only.

Verification

  • npx vitest run --coverage locally produces coverage/lcov.info with 99.11% line coverage
  • CI job updated to generate coverage before SonarCloud upload

- Add vitest.config.ts with lcov coverage reporter
- Update CI sonarqube job: run tests with coverage before scan
- Add sonar.javascript.lcov.reportPaths to sonar-project.properties
@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot bot commented Apr 3, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .github/workflows/ci.yml
  • sonar-project.properties
  • vitest.config.ts

Review Notes

The PR correctly configures SonarCloud coverage reporting:

  1. .github/workflows/ci.yml - The sonarqube job now depends on test job, sets up Node.js 22, installs dependencies, and runs coverage before scanning.

  2. sonar-project.properties - Correctly points to coverage/lcov.info for the LCOV report path.

  3. vitest.config.ts - Configures coverage reporters (text, lcov) which will work with the already-installed @vitest/coverage-v8 package.

The implementation follows standard practices for Vitest + SonarCloud integration.


Reviewed by minimax-m2.5-20260211 · 83,949 tokens

@guyinwonder168 guyinwonder168 merged commit 533385a into main Apr 3, 2026
4 checks passed
@guyinwonder168 guyinwonder168 deleted the fix/sonarcloud-coverage branch April 3, 2026 20:26
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