Were using sonarqube scanner version 4.6.2 and version 6.7.5.38563 on our sonar server.
We are using Jenkins and sonar scanner plugin for analysis.
The code is scanned and bugs are reported in the dashboard however code coverage is shown as 0%.
We are using jest for our unit testing and getting the lcov coverage report output in this folder Client/src/output/coverage/jest/lcov.info
And using jest-sonar package to output a xml file named sonar-report.xml containing information on each unit test
Below is the sonar-project.properties file we are using at the root directory of our project
sonar.language=ts
sonar.sources=Client/src
sonar.sourceEncoding=UTF-8
sonar.testExecutionReportPaths=Client/src/output/sonar-report.xml
sonar.javascript.lcov.reportPaths=Client/src/output/coverage/jest/lcov.info
sonar.test.inclusions=Client/src/**/*.test.ts
sonar.exculsions=**/node_modules/**/*
sonar.tests=Client/src/common
And below is a section of logging connected to the anaylsis step in jenkins:
**15:50:53** WARN: File 'D:\Jenkins\workspace\<****>\Client\src\output\coverage\jest\lcov.info' is ignored because it doesn't belong to the forced language 'ts'
INFO: 2807 files ignored because of inclusion/exclusion patterns
**15:50:53** INFO: Quality profile for ts: Sonar way
**15:50:54** INFO: Sensor Generic Test Executions Report
**15:50:54** WARN: Property 'sonar.genericcoverage.unitTestReportPaths' is deprecated. Please use 'sonar.testExecutionReportPaths' instead.
**15:50:54** INFO: Parsing D:\Jenkins\workspace\*****\src\output\sonar-report.xml
**15:50:54** INFO: Imported test execution data for 0 files
**15:50:54** INFO: Test execution data ignored for 10 unknown files, including:
**15:50:54** common\*****\__tests__\FileName.test.ts
**15:50:54** common\****\__tests__\FileName.test.ts
**15:50:54** common\*****\__tests__\FileName.test.ts
**15:50:54** common\capture\FileName\__tests__\FileName.test.ts
**15:50:54** common\*****\__tests__\FileName.test.ts
**15:50:54** INFO: Sensor Generic Test Executions Report (done) | time=8ms
**15:50:54** INFO: Sensor JaCoCo XML Report Importer [jacoco]
**15:50:54** INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=4ms
**15:50:54** INFO: Sensor JavaXmlSensor [java]
**15:50:54** INFO: Sensor JavaXmlSensor [java] (done) | time=2ms
**15:50:54** INFO: Sensor SonarTS [typescript]
INFO: 62 files analyzed out of 62
**15:51:01** INFO: Sensor SonarTS [typescript] (done) | time=7667ms
**15:51:01** INFO: Sensor Zero Coverage Sensor
**15:51:01** INFO: Sensor Zero Coverage Sensor (done) | time=56ms
**15:51:01** INFO: Sensor CPD Block Indexer
**15:51:01** INFO: Sensor CPD Block Indexer (done) | time=0ms
**15:51:01** INFO: 15 files had no CPD blocks
**15:51:01** INFO: Calculating CPD for 47 files
**15:51:01** INFO: CPD calculation finished
**15:51:02** INFO: Analysis report generated in 234ms, dir size=222 KB
**15:51:02** INFO: Analysis reports compressed in 187ms, zip size=157 KB
**15:51:02** INFO: Analysis report uploaded in 59ms
Hope its okay that i removed some file names and added **** to some folder names. If anyone has any recommendations for getting coverage to show up it would be greatly appreciated