Version of SonarQube: Community Edition 9.3
I am new to SonarQube, and am trying to do some tests on an existing Github repo. I found that the coverage is marked as 0, and learned this is because SonarQube does not run the tests on its own.
Here is what I tried:
-
Clone the Github repo to my local.
-
Create a project in SonarQube and install the sonar-scanner application to my desktop.
-
Run the command:
sonar-scanner \
-Dsonar.projectKey=sonarqube-project-name \
-Dsonar.sources=. \
-Dsonar.projectBaseDir=path/to/github/repo \
-Dsonar.host.url=https://sonarqube.url.com \
-Dsonar.login=my-token
I think that I need to get the “yarn test:coverage” command output to get included in the SonarQube report so that coverage is not 0. Is there something simple I am missing? How can I do this?