- nodejs project with two subdirectories, each of which contain a separate sub-module
- test execution reports and coverage reports are not picked up by scanner
Both of the files, lcov.info and test_results.xml contain relative paths, like:
The problem here is that the relative path does not contain
code - what is correct, because the tests are run from within the
code directory and the scanner says they are ignored:
15:00:59.118 DEBUG: 'code/test/model/user.spec.ts' indexed as test with language 'ts' ... 15:01:10.570 INFO: Test execution data ignored for 5 unknown files, including: test/model/user.spec.ts
The documentation states:
The value specified here becomes the new “analysis directory”, and other paths are then specified as though the analysis were starting from the specified value of sonar.projectBaseDir.
That means that setting
code.sonar.projectBaseDir=code should fix this but it doesn’t. What I can see is that this setting has no effect at all (or it is inferred from the
INFO: SonarScanner 126.96.36.1996 Enterprise EditionVersion 8.5 (build 37579)
PS. This looks really similar to this issue, but it seems noone opened a proper ticket for it.