Travis-CI と統合した後、spec ファイルが何らかの理由でエラーをスローすると、誤検知が発生する可能性があることに気付きました。
travis でリントされたすべてのファイル
Running "jshint:files" (jshint) task
Verifying property jshint.files exists in config...OK
Options: force=false, reporterOutput=null, jshintrc=".jshintrc", ignores=["bower_components/**"]
OK
>> 29 files lint free.
しかし、phantom が起動するとスペックの 1 つが失敗し、これは travis 内でのみ発生します。私は他の同僚が新しいレポをチェックアウトし、問題なく同じ単調なタスクを実行できます。
Testing jasmine specs via phantom
>> Error: xhrFailed at
>> http:/localhost:8000/bower_components/dojo/dojo.js:301
>> http:/localhost:8000/bower_components/dojo/dojo.js:1509
>> http:/localhost:8000/bower_components/dojo/dojo.js:93
>> http:/localhost:8000/bower_components/dojo/dojo.js:728
>> http:/localhost:8000/bower_components/dojo/dojo.js:1247
>> http:/localhost:8000/bower_components/dojo/dojo.js:746
>> http:/localhost:8000/bower_components/dojo/dojo.js:791
>> http:/localhost:8000/bower_components/dojo/dojo.js:124
>> http:/localhost:8000/widgets/tests/spec/SpecSearch.js:379
Jasmine Runner Starting...
このエラーは飲み込まれ、他のスペックファイルが実行され、それらがすべてパスした場合、travis はすべて問題ないと判断します。
これに対抗するにはどのような方法が必要ですか? 基本的に、spec ファイル全体がロードまたは実行されるわけではありませんが、build:passing イメージがあります。出力を見なくても CI を信頼できるようにしたいのです。
grunt travis で 74 個のテストをローカルで実行できますが、travis で実行すると 55 個で合格します。