We recently upgraded SonarQube from 6.x to 7.9.1. There were a lot of issues to deal with, and I’m still left with at least one more.
Our front-end builds were using a gulp plugin to run the scan, and that was working fine. I don’t remember which plugin we were using, but most recently we were using the one that embeds a copy of sonar-scanner. This was failing due to some weird issue about “not finding zip in path”. I never got an answer to this from any of my queries. In any case, this is moot because I’ve moved on from this.
We are now using a direct call to sonar-scanner in our Jenkinsfile.
This is our resulting sonar-scanner command line, with some elisions:
The problem we have now is that this is not finding any unit tests and thus not finding any coverage. The resulting sonarqube project does find many lines to cover, but the same number of uncovered lines. In the build process, I run an “ls -lt” of the “coverage” directory, to make sure that the “lcov.info” and associated files are generated. I pass the relative path to that file in the two associated properties in the command line, as seen above.
In the build output, I do see lines like this:
DEBUG: 'src/api/Api.spec.tsx' indexed as test with language 'ts'
So something detected that was a test, but the resulting project has no unit tests. The generated coverage files have coverage for “src/api/Api.tsx”, but this shows no coverage in the generated project.
What could be wrong here?