question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lcov file misses line numbers.

See original GitHub issue

When the lcov file is generated it is missing line numbers.

This is what is generated:

TN:
SF:./src/app.js
FN:,(anonymous_1)
FN:,(anonymous_2)
FN:,(anonymous_3)
FNF:3
FNH:3
FNDA:7,(anonymous_1)
FNDA:7,(anonymous_2)
FNDA:7,(anonymous_3)
DA:11,1
DA:24,7
DA:27,7
DA:29,7
LF:4
LH:4
BRF:0
BRH:0
end_of_record

You can see FN:,(anonymous_1) which is false because it needs to have a line number before the comma, according to: http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php

My configuration is:

'use strict';

module.exports = function(config) {

  config.set({
    // enable / disable watching file and executing tests whenever any file changes
    autoWatch: true,

    // base path, that will be used to resolve files and exclude
    basePath: '../',

    // testing framework to use (jasmine/mocha/qunit/...)
    frameworks: ['jasmine'],

    // list of files / patterns to load in the browser
    files: [
      'test/spec/**/*.js',
      'app/es6/**/*.js',
    ],

    // list of files / patterns to exclude
    exclude: [],

    // web server port
    port: 9002,

    // Start these browsers, currently available:
    // - Chrome
    // - ChromeCanary
    // - Firefox
    // - Opera
    // - Safari (only Mac)
    // - PhantomJS
    // - IE (only Windows)
    browsers: ['PhantomJS'],

    // Which plugins to enable
    plugins: [
      'karma-phantomjs-launcher',
      'karma-jasmine',
      'karma-coverage',
      'karma-junit-reporter',
      'karma-babel-preprocessor',
      'karma-sourcemap-loader',
    ],

    // coverage reporter generates the coverage
    reporters: ['spec', 'coverage', 'junit'],

    preprocessors: {
      'app/**/*.js': ['babel', 'sourcemap'],
      'test/**/*.js': ['babel', 'sourcemap'],
    },
    babelPreprocessor: {
      options: {
        presets: ['es2015'],
        sourceMap: "inline",
        plugins: ['instanbul']
      }
    },
    // optionally, configure the reporter
    coverageReporter: {
      type: 'lcov',
      dir: 'coverage',
      subdir: 'report'
    }
  });
};

Did I misconfigure something, or did I stumble unto a bug?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Pipemancommented, Jan 13, 2017

We have exactly the same issue as reported by @matteoantoci. Were anyone able to solve the issue? I tried to bump to the latest version, but it didn’t changed anything.

0reactions
bcoecommented, Jul 22, 2017

this should now be fixed \o/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lcov not counting function toplines - Stack Overflow
I am using lcov to generate coverage information for the project I am working on. It is mostly working, except for some reason...
Read more >
Files missing in Coverage "Lines to Cover" - Sonar Community
However, the file covered by the test frontend/reports/coverage/lcov.info is not showing up in the “Coverage > Lines to Cover” panel.
Read more >
Line coverage report using gcov/lcov - Swarming Logic
The .gcda -files contain the interesting coverage data -- which lines were touched, how many times, and which branches it went through.
Read more >
Linux Test Project - Coverage » lcov - SourceForge
Covers the following gcov-related changes in gcc: .gcov-file format: - Line coverage data can appear multiple times for the same line - Line...
Read more >
Reporting — pytest-cov 4.0.0 documentation - Read the Docs
The available reports are terminal (with or without missing line numbers shown), HTML, XML, LCOV and annotated source code. The terminal report without...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found