我正在努力让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试图访问它之前,业力是否没有生成文件?它是否在其他目录中生成?任何帮助表示赞赏!
答案 0 :(得分:1)
只需要全局安装codeclimate-test-reporter
而不是本地