Cannot get the coverage from a LCOV file in a Typescript project

  • ALM used: GitHub
  • CI system used: GitHub Actions
  • Languages of the repository: Typescript

Hello. I’m trying to use a LCOV file to get the coverage of a Typescript project.

I’m using this action:

To analyze this project

https://sonarcloud.io/summary/overall?id=kuoki-environment

As you can see in this execution, I made a cat at the end of the action to ensure that the lcov file is present.

The log doesn’t display any error. I’ve been searching in this forum and tried a lot of things, as you can see in the history of the files and the executions. Anyone have any tip to get the coverage?

Lots of thanks in advance.

LOG

INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.12 Alpine (64-bit)
INFO: Linux 5.11.0-1025-azure amd64
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarCloud
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=746ms
INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
INFO: User cache: /opt/sonar-scanner/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=164ms
INFO: Load/download plugins (done) | time=30884ms
INFO: Loaded core extensions: developer-scanner
INFO: Found an active CI vendor: 'Github Actions'
INFO: Load project settings for component key: 'kuoki-environment'
INFO: Load project settings for component key: 'kuoki-environment' (done) | time=142ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: kuoki-environment
INFO: Base dir: /github/workspace
INFO: Working dir: /github/workspace/.scannerwork
INFO: Load project branches
INFO: Load project branches (done) | time=142ms
INFO: Check ALM binding of project 'kuoki-environment'
INFO: Detected project binding: NOT_BOUND
INFO: Check ALM binding of project 'kuoki-environment' (done) | time=137ms
INFO: Load project pull requests
INFO: Load project pull requests (done) | time=136ms
INFO: Load branch configuration
INFO: Github event: workflow_dispatch
INFO: Load branch configuration (done) | time=4ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=173ms
INFO: Load active rules
INFO: Load active rules (done) | time=4522ms
INFO: Organization key: kuoki
INFO: Load project repositories
INFO: Load project repositories (done) | time=184ms
INFO: Indexing files...
INFO: Project configuration:
INFO:   Excluded sources: **/build-wrapper-dump.json, **/*.spec.ts
INFO: 44 files indexed
INFO: 18 files ignored because of inclusion/exclusion patterns
INFO: 0 files ignored because of scm ignore settings
INFO: Quality profile for ts: Sonar way
INFO: ------------- Run sensors on module Environment
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=147ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=3ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=25ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=6ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=2ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=24ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
INFO: Sensor TypeScript analysis [javascript]
INFO: Deploying custom rules bundle jar:file:/opt/sonar-scanner/.sonar/cache/9b75171805133ce5c4b9d6d9c3bde69c/sonar-securityjsfrontend-plugin.jar!/js-vulnerabilities-rules-1.0.0.tgz to /github/workspace/.scannerwork/.sonartmp/eslint-bridge-bundle/package/custom-rules14002007182860087673
INFO: Found 1 tsconfig.json file(s): [/github/workspace/packages/environment/tsconfig.json]
INFO: Creating TypeScript program
INFO: TypeScript configuration file /github/workspace/packages/environment/tsconfig.json
INFO: 44 source files to be analyzed
INFO: Creating TypeScript program (done) | time=52ms
INFO: Starting analysis with current program
INFO: Analyzed 0 file(s) with current program
INFO: Creating TypeScript program
INFO: TypeScript configuration file /github/workspace/packages/environment/tsconfig.lib.json
INFO: Creating TypeScript program (done) | time=1216ms
INFO: Starting analysis with current program
INFO: Analyzed 44 file(s) with current program
INFO: Creating TypeScript program
INFO: TypeScript configuration file /github/workspace/packages/environment/tsconfig.spec.json
INFO: Creating TypeScript program (done) | time=885ms
INFO: Starting analysis with current program
INFO: Analyzed 0 file(s) with current program
INFO: 44/44 source files have been analyzed
INFO: Sensor TypeScript analysis [javascript] (done) | time=10605ms
INFO: Sensor CSS Rules [javascript]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [javascript] (done) | time=1ms
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=1ms
INFO: Sensor Serverless configuration file sensor [security]
INFO: 0 Serverless function entries were found in the project
INFO: 0 Serverless function handlers were kept as entrypoints
INFO: Sensor Serverless configuration file sensor [security] (done) | time=4ms
INFO: Sensor AWS SAM template file sensor [security]
INFO: Sensor AWS SAM template file sensor [security] (done) | time=1ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/.scannerwork/ucfg2/java
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/.scannerwork/ucfg2/java
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=6ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/ucfg_cs2
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/ucfg_cs2
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=2ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/.scannerwork/ucfg2/php
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/.scannerwork/ucfg2/php
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=1ms
INFO: Sensor PythonSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/.scannerwork/ucfg2/python
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/.scannerwork/ucfg2/python
INFO: No UCFGs have been included for analysis.
INFO: Sensor PythonSecuritySensor [security] (done) | time=1ms
INFO: Sensor JsSecuritySensor [security]
INFO: Reading type hierarchy from: /github/workspace/.scannerwork/ucfg2/js
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /github/workspace/.scannerwork/ucfg2/js
INFO: 00:17:54.070365 Building Runtime Type propagation graph
INFO: 00:17:54.098585 Running Tarjan on 931 nodes
INFO: 00:17:54.106607 Tarjan found 931 components
INFO: 00:17:54.111687 Variable type analysis: done
INFO: 00:17:54.113256 Building Runtime Type propagation graph
INFO: 00:17:54.119513 Running Tarjan on 931 nodes
INFO: 00:17:54.120447 Tarjan found 931 components
INFO: 00:17:54.122426 Variable type analysis: done
INFO: Analyzing 163 ucfgs to detect vulnerabilities.
INFO: Taint analysis starting. Entrypoints: 45
INFO: Running symbolic analysis for 'JS'
INFO: Taint analysis: done.
INFO: Sensor JsSecuritySensor [security] (done) | time=943ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=10ms
INFO: CPD Executor 35 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 9 files
INFO: CPD Executor CPD calculation finished (done) | time=11ms
INFO: Analysis report generated in 158ms, dir size=284 KB
INFO: Analysis report compressed in 89ms, zip size=113 KB
INFO: Analysis report uploaded in 550ms
INFO: ANALYSIS SUCCESSFUL, you can find the results at: https://sonarcloud.io/dashboard?id=kuoki-environment
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 https://sonarcloud.io/api/ce/task?id=AX55_zVtzH1p4N_Bvqdu
INFO: Analysis total time: 28.018 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:03.896s
INFO: Final Memory: 40M/132M
INFO: ------------------------------------------------------------------------
TN:
SF:packages/environment/src/lib/helpers/async-not-nil.function.ts
FN:25,asyncNotNil
FN:26,(anonymous_1)
FN:34,notNilDueOperator
FN:35,(anonymous_3)
FNF:4
FNH:4
FNDA:6,asyncNotNil
FNDA:6,(anonymous_1)
FNDA:6,notNilDueOperator
FNDA:6,(anonymous_3)
DA:1,7
DA:3,7
DA:25,7
DA:26,6
DA:28,6
DA:35,6
DA:36,6
LF:7
LH:7
BRDA:36,0,0,4
BRDA:36,0,1,2
BRF:2
BRH:2
end_of_record
TN:
SF:packages/environment/src/lib/helpers/filter-nil.operator.ts
FN:15,filterNil
FN:16,(anonymous_1)
FNF:2
FNH:2
FNDA:13,filterNil
FNDA:29,(anonymous_1)
DA:2,8
DA:15,8
DA:16,29
LF:3
LH:3
BRF:0
BRH:0
end_of_record
TN:
SF:packages/environment/src/lib/helpers/index.ts
FNF:0
FNH:0
DA:17,6
DA:1,6
LF:1
LH:1
BRF:0
BRH:0
end_of_record
TN:
SF:packages/environment/src/lib/shared/merge-arrays-customizer.function.ts
FN:4,mergeArraysCustomizer
FNF:1
FNH:1
FNDA:15,mergeArraysCustomizer
DA:4,7
DA:5,15
DA:6,2
DA:9,13
LF:4
LH:4
BRDA:5,0,0,2
BRDA:5,1,0,15
BRDA:5,1,1,3
BRF:3
BRH:3
end_of_record
TN:
SF:packages/environment/src/lib/source/environment-source.gateway.ts
FNF:0
FNH:0
DA:9,2
LF:1
LH:1
BRF:0
BRH:0
end_of_record
TN:
SF:packages/environment/src/lib/source/index.ts
FNF:0
FNH:0
DA:5,2
LF:1
LH:1
BRF:0
BRH:0
end_of_record
TN:
SF:packages/environment/src/lib/store/environment-store.gateway.ts
FNF:0
FNH:0
DA:8,7
LF:1
LH:1
BRF:0
BRH:0
end_of_record

Hey there.

Should be an easy fix. Make sure to use sonar.javascript.lcov.reportPaths instead of sonar.typescript.lcov.reportPaths (which does nothing). The valid parameters are listed in the documentation on Test Coverage & Execution.

Ok, lts working now. Lots of thanks. I tried this also, but maybe one of many failed combinations.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.