Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0.2 lcov.info absolute paths now incorrectly translated to relative paths #415

Closed
tande35006 opened this issue Apr 27, 2020 · 4 comments

Comments

@tande35006
Copy link

Updated from karma-coverage 2.0.1 to 2.0.2 and the paths in the lcov.info are now being translated to relative paths. Using sonarcloud.io for coverage analysis which doesn't support the relative paths.

v2.0.1 lcov.info file:
image

v2.0.2 lcov.info file now produces:

image

sonarcloud log:
image

@anthony-redFox
Copy link
Collaborator

@tande35006 try to use relativePath: false for lcov report

@gingemonster
Copy link

gingemonster commented May 11, 2020

anyone got this working, not 100% sure where the "relativePath: false" flag should be set? I assume in karma.config.js so I tried a few places and none seem to work. Where should it go?

coverageReporter: {
  reporters: [ 
    { type: 'html' },
    { type: 'lcovonly', file: '../../../../lcov.info' },
    { type: 'text-summary' },
    { type: 'teamcity' }
  ],
  dir: path.resolve(__dirname, 'coverage-karma'),
  subdir: '.',
},

@anthony-redFox
Copy link
Collaborator

sorry, it is my mistake. it is issue istanbuljs/istanbuljs#529

you can define projectRoot for project and should be resolved

@moussetc
Copy link

@anthony-redFox

sorry, it is my mistake. it is issue istanbuljs/istanbuljs#529

you can define projectRoot for project and should be resolved

Hi, I'm struggling with this issue and I don't see how to define this projectRoot option with Karma. Could you provide a karma.conf example that generates absolute path with karma-coverage >= 2.0.2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants