No coverage information will be saved because all LCOV files cannot be found

  • SonarQube Enterprise 9.7.1, SonarScanner CLI v4.6.1.2450
  • We are trying to scan a Ext.JS project tests and provide code coverage reports
  • We’re using karma and jasmine
  • We are running SonarScanner CLI with the following property:
  • We tried this too and had the same issue:
  • Issue:

[2022-11-24T13:48:36.994Z] 08:48:36.929 INFO: Sensor JavaScript/TypeScript Coverage [javascript]
[2022-11-24T13:48:36.994Z] 08:48:36.930 DEBUG: Property sonar.javascript.lcov.reportPaths is used.
[2022-11-24T13:48:36.994Z] 08:48:36.930 DEBUG: Using './TestResults/coverage/' to resolve LCOV files
[2022-11-24T13:48:36.994Z] 08:48:36.959 INFO: No LCOV files were found using ./TestResults/coverage/
[2022-11-24T13:48:36.994Z] 08:48:36.959 WARN: No coverage information will be saved because all LCOV files cannot be found.
[2022-11-24T13:48:36.994Z] 08:48:36.959 INFO: Sensor JavaScript/TypeScript Coverage [javascript] (done) | time=30ms

Our karma.conf.js:

module.exports = function(config) {

    basePath: '',

    frameworks: ['jasmine'],

    plugins : [

    files: [

        { pattern: 'ext/**/*.*', watched: false, served: true, included: false},
        { pattern: 'app/**/*.js', watched: true, served: true, included: true },
        { pattern: 'specs/**/*.js', watched: false, served: true, included: true },

    // for now we're ignoring these files
    exclude: ['specs/model/*Spec.js',

    preprocessors: {
      'app/**/*.js': ['coverage'],
      'overrides/*.js': ['coverage']

    reporters: ['junit', 'coverage', 'progress'],

    port: 9876,

    colors: true,

    logLevel: config.LOG_INFO,

    autoWatch: true,

    browsers: ['PhantomJS'],

    singleRun: true,

    concurrency: Infinity,

    captureTimeout : 60000,
    browserDisconnectTimeout : 60000,
    browserNoActivityTimeout : 60000,

    junitReporter: {
      outputDir: '../TestResults',
      suite: 'models',
      useBrowserName: false,
      xmlVersion: '1'

    coverageReporter: {
      type: 'lcov',
      dir: '../TestResults/coverage',
      subdir: '.'

The project structure:

  |    |----coverage
  |    |     |
  |    |----apps // js files
  |    |----specs // tests
  |    |----karma.conf.js

The weirdest thing is that the file exists on the folder when SonarScanner starts to run.

Any help would be greatly appreciated! Thank you in advance!

Hey there.

What directory are you initiating the SonarQube scan from? The root directory?

This will be the correct format.

Hi there!

Yeah, the SonarQube scan is been executed on the root directory. The sonar.sources is going through all the directories on the project.

Hey there.


I would suggest two things:

  • Supply the complete analysis logs (redacting sensitive info if necessary).
  • Not knowing the full details of your build, you might try printing the content of TestResults/coverage/ immediately before the scanner, just to be extra sure it exists at the right time. Something like cat TestResults/coverage/


So we figured out what was the main issue and I decided to share here hopping help someone… The file was not the problem.

The further issue with SonarScan process was:

WARN: Could not resolve X file paths in...

It happens then without tsconfig.json or sonar.sources the pipeline is not able to find relative paths:


And instead, it needs an absolute path:


So what we did to fix it was added to our build run batch a convert lcov path action:

$currentDirectory = Get-Location
$replacement = "SF:" + $currentDirectory + "\"
$content = Get-Content -Path 'TestResults\coverage\'
$newContent = $content -replace 'SF:', $replacement
$newContent | Set-Content -Path 'TestResults\coverage\'

With this, we’re able to fix all paths on generated file before running SonarScan.

Thank you for your help!

The insight about the directory that Sonar Scan was initializing really got us on the right path :wink:

1 Like

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