4

TravisCI ビルドは私のオープンソース プロジェクトに合格しており、現在、gulp-coveralls を統合しようとしています。Coveralls.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());
});

カルマ.conf.js:

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

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

Karma と PhantomJS を使用してテストを実行しています。ファイル coverage/lcov.info は確実に生成されています。何が起こっているのでしょうか?

4

3 に答える 3

4

サラ、

不足しているのは、カバーオール リポジトリ トークンです。coveralls.io に移動し、GitHub アカウントを使用してログインを作成する必要があります。これにより、すべてのリポジトリがカバーオールに取り込まれます。次に、カバーオールを使用するレポで、[オフ] スイッチをクリックしてカバーオールをオンにします。

「カバーオールの表示」ボタンをクリックすると、レポキーが表示されます。次に、.coveralls.yml ファイルを作成し、そのファイルにキーをコピーすることでセットアップできます。これで問題が解決するはずです。

于 2014-09-01T23:46:35.347 に答える
0

.coveralls.yml ファイルに誤りがある可能性があります。Travis CI を使用している場合は、これを試してください。

service_name: travis-ci
repo_token: token_given

Travis Pro を使用している場合:

service_name: travis-pro
repo_token: token_given

これが役立つことを願っています。

于 2014-12-17T17:45:49.107 に答える
0

travis-ci.orgで実行されている GitHub ビルドの場合、.coveralls.yml ファイルにサービス名は必要なく、トークンだけが必要です。Travis でビルドを渡す必要もありません。LCOV データとそれを送信するプラグインを正常に生成するだけです。

を使用してファイルから読み取ったときに、LCOV データがカバーオールに適切に送信されないという gulp-coveralls に関する 1 つの問題がありましたgulp.src。最終的に機能する唯一の方法は、中間ファイルを使用して最初に保存するのではなく、LCOV データをプラグインに直接送信することでした。

LCOV データを gulp-coveralls にパイプし JSON/HTML レポートlazy-pipeを作成するために、最終的に再利用可能なステップを作成することにしました。

完全なプロジェクトは、GitHub のangular-loggerにあります。

// .coveralls.yml
repo_token: the_token
var jasmine = require('gulp-jasmine');
var cover = require('gulp-coverage');
var coveralls = require('gulp-coveralls');
var lazypipe = require('lazypipe');

(..)

// gulpfile.js
var testAndGather = lazypipe()
    .pipe(cover.instrument, {
        pattern: ['src/**/*.js'],
        debugDirectory: 'debug'
    })
    .pipe(jasmine, {includeStackTrace: true})
    .pipe(cover.gather);

gulp.task('test', ['build'], function () {
    gulp.src('spec/**/*spec.js')
        .pipe(testAndGather())
        .pipe(cover.format(['html']))
        .pipe(gulp.dest('reports'));
});

gulp.task('travis', ['build'], function () {
    gulp.src('spec/**/*spec.js')
        .pipe(testAndGather())
        .pipe(cover.format(['lcov']))
        .pipe(coveralls()); // directly pipe into coveralls
});

使用:

"gulp-jasmine": "~2.0.1",
"gulp-coverage": "~0.3.35",
"gulp-coveralls": "~0.1.4",
"lazypipe": "~0.2.3"
于 2015-05-26T07:40:08.163 に答える