Travis vs fastboottesting:spawn / bin / sh ENOENT

我试图在travis上运行ember fastboottesting。 所有在本地机器上正常工作。 但在travisCi上失败了

经过多次实验,我下载了Docker镜像和托盘以在本地重现。 我可以。

但!

在失败后,我再次运行我的testing命令后,它成功通过

bower ember#2.4.3 install ember#2.4.3 bower ember-cli-test-loader#0.2.2 install ember-cli-test-loader#0.2.2 bower ember-cli-shims#0.1.1 install ember-cli-shims#0.1.1 bower qunit#1.20.0 install qunit#1.20.0 ember#2.4.3 bower_components/ember └── jquery#2.1.4 ember-cli-test-loader#0.2.2 bower_components/ember-cli-test-loader ember-cli-shims#0.1.1 bower_components/ember-cli-shims └── ember#2.4.3 qunit#1.20.0 bower_components/qunit travis@9df7db66cd9d:~/vvroom$ su Password: su: Authentication failure travis@9df7db66cd9d:~/vvroom$ node tests/fastboot-test-runner.js PATH: /home/travis/.nvm/versions/node/v6.9.2/bin /home/travis/.gimme/versions/go1.4.1.linux.amd64/bin /home/travis/.rvm/gems/ruby-1.9.3-p551/bin /home/travis/.rvm/gems/ruby-1.9.3-p551@global/bin /home/travis/.rvm/rubies/ruby-1.9.3-p551/bin /usr/local/phantomjs/bin ./node_modules/.bin /usr/local/maven-3.2.5/bin /usr/local/clang-3.4/bin /usr/local/bin /usr/bin /bin /usr/local/games /usr/games /home/travis/.rvm/bin /home/travis/.rvm/bin /home/travis/.rvm/bin spawn: ["ember",["fastboot","--serve-assets"]] There was an error trying to run your application in FastBoot. This is usually caused by either your application code or an addon trying to access an API that isn't available in Node.js. Based on the stack trace, it looks like the exception was generated in util.js on line 1022. The exception is probably coming from your app. Look at this file and line number to determine what is triggering the exception. The full stack trace is: spawn /bin/sh ENOENT Error: spawn /bin/sh ENOENT at exports._errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32) at onErrorNT (internal/child_process.js:359:16) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickDomainCallback (internal/process/next_tick.js:122:9) ^C travis@9df7db66cd9d:~/vvroom$ node tests/fastboot-test-runner.js PATH: /home/travis/.nvm/versions/node/v6.9.2/bin /home/travis/.gimme/versions/go1.4.1.linux.amd64/bin /home/travis/.rvm/gems/ruby-1.9.3-p551/bin /home/travis/.rvm/gems/ruby-1.9.3-p551@global/bin /home/travis/.rvm/rubies/ruby-1.9.3-p551/bin /usr/local/phantomjs/bin ./node_modules/.bin /usr/local/maven-3.2.5/bin /usr/local/clang-3.4/bin /usr/local/bin /usr/bin /bin /usr/local/games /usr/games /home/travis/.rvm/bin /home/travis/.rvm/bin /home/travis/.rvm/bin spawn: ["ember",["fastboot","--serve-assets"]] spawn: ["mocha",["--recursive","tests/fastboot-tests"]] Mocha: Shared group Object page (collectable) ✓ should dislay data (3101ms) Shared group List of objects ✓ should dislay cards for loaded objects with correct types detection (1655ms) Shared group List of objects ✓ Should content title `Private Viewing Room` (1438ms) 3 passing (6s) -- Tests completed -- 

在我的testing跑步者里面

 function runFastBootServer() { const fbServer = spawn('ember', ['fastboot', '--serve-assets']); fbServer.on('error', (err) => { console.error(err); exit(15, 'Ember fastboot run failed'); }); fbServer.stderr.on('data', (data) => console.error(`${data}`)); fbServer.stdout.on('data', function waitFastBootRunning(data) { if (`${data}`.match(/Ember FastBoot running at/)) { fbServer.stdout.removeListener('data', waitFastBootRunning); runMochaTests(); } }); fbServer.stdout.on('close', (code) => { console.log(`FastBoot server closed with code: ${code}`); if (code) { exit(code, 'FastBoot server error'); } }); fbServer.stdout.on('exit', (code) => { console.log(`FastBoot server exited with code: ${code}`); if (code) { exit(code, 'FastBoot server error'); } }); return fbServer; } runFastBootServer(); 

因此,我只能在第一次运行时出错 – 我找不到原因/解决方法。 有任何想法吗? 怎么解决? 而为什么它在第二次运行罚款?

Interesting Posts