Sonarcloud - TypeScript Project

Hi ,

We are using SonarCloud and a React/TypeScript project has been added using automatic analysis. It works well for Code smells, vulnerabilities. We use this as check for PRs to merge.

We now would like to add code coverage. I followed this blog post and generated the coverage xml - I am not sure how to wire it with the existing project in SonarCloud.

Any pointers on the last mile please …

  1. Can automatic analysis and Code coverage co-exist?

  2. Also, I added in the root of my project. Do I need to add anything else for Sonarqube?

Hello @MomEngineer,

One of the current limitations of Automatic Analysis is that we don’t support importing code coverage. To import code coverage you will have to run the analysis in a CI. On SonarCloud you can browse to your project > Administration > Analysis Method to follow the tutorial on how to set-up the analysis in your preferred CI.

A file will not be automatically picked up. If you continue using Automatic Analysis you can use the filename If you decide to run the analysis in your CI you will want to use the filename (this will also be shown in the tutorial).

Hope that helps!

Thank you!
I created another project in my organization for manual code-coverage analysis.
I also changed the filename as per your suggestion.
As part of my PoC, I would like to push to my sonarcloud manual cod-coverage project.
I am missing the final piece of how to actually push this data into sonarcloud given I have the property file and the coverage information generated using npm test -- --coverage --watchAll=false