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 …
Can automatic analysis and Code coverage co-exist?
Also, I added sonarqube.properties in the root of my project. Do I need to add anything else for Sonarqube?
A sonarqube.properties file will not be automatically picked up. If you continue using Automatic Analysis you can use the filename .sonarcloud.properties. If you decide to run the analysis in your CI you will want to use the sonar-project.properties filename (this will also be shown in the tutorial).
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 lcov.info 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