简体   繁体   English

Travis CI找不到业力生成的lcov.info文件

[英]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 . 我正在尝试获取CodeClimate的代码覆盖率,以便在我的GitHub Repo上工作。 Travis CI doesn't find the lcov.info file that is generated by Karma after testing. Travis CI在测试后找不到由Karma生成的lcov.info文件。 I tried using a glob like this answer but even codeclimate-test-reporter < **/*lcov.info doesn't work. 我尝试使用像这样的答案这样的glob,但即使codeclimate-test-reporter < **/*lcov.info也无法正常工作。

Karma generates the lcov.info file in /coverage/PhantomJS 1.9.8 (Windows 7 0.0.0)/lcov.info . Karma在/coverage/PhantomJS 1.9.8 (Windows 7 0.0.0)/lcov.info生成lcov.info文件。 I've set the token environment variable in Travis CI and locally. 我已经在Travis CI和本地设置了令牌环境变量。

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.yml在Travis CI中运行它。 Travis CI can't find the file. Travis CI找不到文件。

Karma.conf.js Karma.conf.js

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

.travis.yml .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? 在Travis CI尝试访问文件之前,业力是否未生成文件? Is it getting generated in some other directory? 它是否在其他目录中生成? Any help is appreciated! 任何帮助表示赞赏!

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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