Travis CI无法找到Karma生成的lcov.info文件

时间:2015-07-30 18:29:43

标签: javascript code-coverage karma-runner travis-ci code-climate

我正在努力让CodeClimate的代码覆盖率适用于my GitHub Repo。 Travis CI在测试后未找到由Karma生成的lcov.info文件。我尝试使用类似this的回答,但即使codeclimate-test-reporter < **/*lcov.info也不起作用。

Karma在lcov.info中生成/coverage/PhantomJS 1.9.8 (Windows 7 0.0.0)/lcov.info文件。我在Travis CI和本地设置了令牌环境变量。

在本地运行:

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

通过.travis.yml在Travis CI中运行它不起作用。 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

那么这笔交易是什么?在Travis CI试图访问它之前,业力是否没有生成文件?它是否在其他目录中生成?任何帮助表示赞赏!

1 个答案:

答案 0 :(得分:1)

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