gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 787 forks source link

Conglomerating lcov.info #721

Open ORESoftware opened 7 years ago

ORESoftware commented 7 years ago

Another question for you all! On the surface this is a question about TravisCI but actually it's about how to get all your coverage info into one lcov.info file -

I am using istanbul report like so:

istanbul report --dir coverage --include **/*coverage.json lcov

supposedly the lcov format option should output both html and lcov.info files.

perhaps I should be doing this instead?

istanbul report --dir coverage --include **/*coverage.json --include **/*lcov.info lcov

I have the following in my .travis.yml file

language: node_js
node_js:
  - '7',
  - '6',
  - '5',
  - '4'
script: 'node index --coverage test/testsrc/es5-es6 -r'
after_script: 'cat coverage/lcov.info | coveralls'

I am concerned about the last line - after_script: 'cat coverage/lcov.info | coveralls'

That lcov.info file doesn't seem to possibly contain all of the lcov.info data from each separate istanbul run.

I am using istanbul report, but it looks like not all lcov.info files get put into that one file. Each subdirectory in the coverage directory has its own lcov.info file, but it doesn't look like all the lcov.info data get concatenated/conglomerated into the one lcov.info file directly inside the coverage dir.

Is there a way to configure Istanbul so that when you run istanbul report it does conglom all the coverage info into one lcov.info file?

ORESoftware commented 7 years ago

Even if I use lcovonly, it still seems to give me html reports, weird