我的开源项目正在使用TravisCI构建,现在我正在尝试集成gulp-coveralls。在Coverovers.io上,即使自从我将仓库添加到Coveralls后Travis生成已成功运行,也无法为我的存储库找到任何生成。

'There have been no builds for this repo.'

当我尝试运行gulp-coveralls gulp任务时,出现以下错误:
'Repo token could not be determined.  Continuing without it.'
Error in plugin 'gulp-coveralls'
Bad response:422 {"message":"Couldn't find a repository matching this job.","error":true}
    at handleError (/Users/sarah.green/angular-embedly/node_modules/gulp-coveralls/index.js:11:30)
    at sendToCoverallsCallback (/Users/sarah.green/angular-embedly/node_modules/gulp-coveralls/index.js:19:9)
    at /Users/sarah.green/angular-embedly/node_modules/gulp-coveralls/index.js:31:13
    at Request._callback (/Users/sarah.green/angular-embedly/node_modules/gulp-coveralls/node_modules/coveralls/lib/sendToCoveralls.js:7:5)
    at Request.self.callback (/Users/sarah.green/angular-embedly/node_modules/gulp-coveralls/node_modules/coveralls/node_modules/request/index.js:142:22)
    at Request.EventEmitter.emit (events.js:98:17)
    at Request.<anonymous> (/Users/sarah.green/angular-embedly/node_modules/gulp-coveralls/node_modules/coveralls/node_modules/request/index.js:856:14)
    at Request.EventEmitter.emit (events.js:117:20)
    at IncomingMessage.<anonymous> (/Users/sarah.green/angular-embedly/node_modules/gulp-coveralls/node_modules/coveralls/node_modules/request/index.js:808:12)
    at IncomingMessage.EventEmitter.emit (events.js:117:20)
    at _stream_readable.js:919:16
    at process._tickCallback (node.js:419:13)

到目前为止,这是我得到的:

我在package.json中的开发依赖项中的gulp-coveralls

gulpfile.js:
var coveralls = require('gulp-coveralls');
...
gulp.task('coveralls', function () {
gulp.src('coverage/**/lcov.info')
  .pipe(coveralls());
});

karma.conf.js:
coverageReporter: {
    type : 'lcov',
    dir : 'coverage/'
}

Github:https://github.com/lithiumtech/angular-embedly

我使用Karma和PhantomJS进行测试。肯定会生成文件coverage / lcov.info。知道会发生什么吗?

最佳答案

莎拉,

您缺少的是工作服存储库 token 。您必须转到coveralls.io并使用Gi​​tHub帐户创建登录名。然后,这会将您所有的回购放入工作服。然后,对于要用于工作服的仓库,您可以通过单击“关闭”开关来打开工作服。

现在,单击“查看工作服”按钮,它将显示您的存储库密钥。然后,您可以通过创建.coveralls.yml文件并将密钥复制到该文件中来进行设置。这应该可以解决您的问题。

07-28 11:04