Test Coverage for GitHub project running jest tests not populating any data

Template for a good new topic, formatted with Markdown:

  • GitHub hosted project
  • GitHub Action workflow
  • Scanner: SonarSource/sonarcloud-github-action@master
  • Javascript/Typescript

We implemented the test coverage for a private project with SonarCloud. We have created a build.yaml workflow to run the UI unit test as yarn jest --coverage and created a related sonar-project.properties file as well. We have setup everything we know but the project dashboard still shows

“A few extra steps are needed for SonarCloud to analyze your code coverage.”

Please kindly advise if we missed anything.

Thank you very much.

Hey there.

I think you’re facing a bug that was already reported:

It only affects PRs/short-lived branches with no lines of code that can be covered by tests (0 new lines)

A fix is scheduled for an upcoming hardening sprint. You should be able to verify that coverage is read correctly by running an analysis (with coverage generated and passed to the scanner) on your main branch.

Thank you so much for sharing the details. Will double check once the fix is deployed. :pray:

Hey @Chong_Xiang

This issue has been fixed. :pray:

Thank you so much @Colin . Yes, we also noticed the data in our project now. Thank you :pray: :grinning: