I am trying to add test coverage to my GitHub Action workflow that uses sonarcloud-github-action@v1.9. Basically I have a monorepo-ish repository where each subdirectory is a separate npm typescript project. I am currently running the sonar cloud analysis just fine as a single project, but the analysis complains about test coverage (since I haven’t set it up yet).
Let’s call the repository exampleproject
and the component rest-api
to protect sensitive information, /
is the repository root.
- The build process for
rest-api
will appendrest-api/
to all the file paths inlcov.info
so that they match what sonar expects (same paths as I can see for the tests in SonarCloud GUI) and then save it to/sonar-coverage/lcov-rest-api.info
. I have verified withls
in the Sonar job that the file exists and I have downloaded it from artifacts to verify that it is correct. - Then
sonarcloud-github-action
will run with parameters-Dsonar.organization=exampleorg -Dsonar.projectKey=exampleorg_exampleproject -Dsonar.coverage.javascript.lcov.reportPaths=sonar-coverage/lcov-rest-api.info -X
. - The whole process ends successfully, but the sonarcloud comment in the PR still says “No Coverage information”.
The only hint I can find in the DEBUG logs of the Scan
step is DEBUG: 'JavaScript/TypeScript Coverage' skipped because one of the required properties is missing
. How do I figure out which property is missing?