After setting up SonarQube and SonarScanner and successfully scanning my project, I noticed that all metrics appear on my screen except for code coverage, which remains at 0%. What could be causing this issue?
#----- Default SonarQube server
sonar.host.url=http://localhost:9000/sonar
#----- Default source code encoding
#sonar.sourceEncoding=UTF-8
# must be unique in a given SonarQube instance
sonar.projectKey=pwta
# this is the name and version displayed in the SonarQube UI. Was mandatory prior to SonarQube 6.1.
sonar.projectName=PWTA
sonar.projectVersion=1.0
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# This property is optional if sonar.modules is set.
sonar.sources=client
sonar.language=ts
sonar.exclusions=**/node_modules/**
sonar.typescript.lcov.reportPaths=coverage/lcov.info
The above snippet is from the sonar-project.properties file. The LCOV file located at coverage/lcov.info was generated using the nyc library.
https://i.sstatic.net/eO2S8.jpg
Logs extracted from the command prompt:
INFO: Scanner configuration file: NONE
INFO: Project root configuration file: C:\Repos\pwta-desktop\ui\sonar-project.properties
...
...continues...
...
INFO: Sensor Zero Coverage Sensor (done) | time=248ms
INFO: ------------- Run sensors on project
INFO: SCM provider for this project is: git
INFO: 1 files to be analyzed
INFO: 0/1 files analyzed
WARN: Missing blame information for the following files:
WARN: * client/version.ts
WARN: This may lead to missing/broken features in SonarQube
INFO: 43 files had no CPD blocks
INFO: Calculating CPD for 300 files
INFO: CPD calculation finished
INFO: Analysis report generated in 3904ms, dir size=2 MB
INFO: Analysis report compressed in 3421ms, zip size=1 MB
INFO: Analysis report uploaded in 145ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/sonar/dashboard?id=pwta
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://localhost:9000/sonar/api/ce/task?id=AWmkhBxOhYEp7lx6Lmb2
INFO: Analysis total time: 1:01.823 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: Total time: 1:04.060s
INFO: Final Memory: 19M/407M
INFO: ------------------------------------------------------------------------
The log indicates that the lcov file is being successfully located.
Additionally, there seems to be a complaint regarding a path mentioned in the log above. Could this be contributing to the issue?