I have an OSS project on GitHub. I used the GitHub App for SonarCloud integration (thanks for providing that for free!) I don’t get any test coverage reporting during builds.
I have a GH action that runs vitest run --coverage but that coverage is not relayed to SC. I have a separate step that pushes the coverage to Coveralls, but that works because it’s an action step.
Is the only way to get SC coverage is if I manually setup a step in the action instead of the automatic scanning?
We don’t pick up coverage reports automatically; you have to configure analysis to read them. Doing so is fairly simple though; just add the correct parameter with a path to the report(s) to be read.
That said, it doesn’t look like we support vitest, so you would need a pre-step to convert it to a supported format.
Could you check your Project Administration → Background Tasks → [row dots menu] → Show SonarScanner Context and make sure sonar.javascript.lcov.reportPaths=./coverage/lcov.info shows up there?
Thanks for the context. Can you also provide your analysis log?
The analysis / scanner log is what’s output from the analysis command. Hopefully, the log you provide - redacted as necessary - will include that command as well.
Are you using automatic analysis? We don’t support the import of coverage reports in that case. You’ll need to switch to a CI / GH Actions analysis for that.