简体   繁体   中英

Travis CI Can't Find Karma Generated lcov.info File

I'm trying to get CodeClimate's code coverage to work on my GitHub Repo . Travis CI doesn't find the lcov.info file that is generated by Karma after testing. I tried using a glob like this answer but even codeclimate-test-reporter < **/*lcov.info doesn't work.

Karma generates the lcov.info file in /coverage/PhantomJS 1.9.8 (Windows 7 0.0.0)/lcov.info . I've set the token environment variable in Travis CI and locally.

Running this locally works:

codeclimate-test-reporter < "coverage/PhantomJS 1.9.8 (Windows 7 0.0.0)/lcov.info"

Running it in Travis CI via .travis.yml does not work. Travis CI can't find the file.

Karma.conf.js

coverageReporter: {
  type : 'lcovonly',
  dir : 'coverage/'
}

.travis.yml

language: node_js
node_js:
  - "0.12"
  - "0.11"
  - "0.10"
  - "iojs"
after_script:
  - npm install codeclimate-test-reporter
  - codeclimate-test-reporter < **/*lcov.info

So whats the deal? Is karma not generating the file before Travis CI tries to access it? Is it getting generated in some other directory? Any help is appreciated!

只需在全局而不是本地安装codeclimate-test-reporter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM