lundi 2 janvier 2017

Travis vs fastboot tests: spawn /bin/sh ENOENT

I'm trying to run ember fastboot tests on travis. All works fine on local machine. But failed on travisCi

After a number of experiments I download docker image and tray to reproduce it locally. And i can.

But!

after I run my test command once more just after fail - it passed successfully

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 --

inside my test runner I have

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();

And thus I get error only on first run - I can't find reasons / solution. Any ideas? How to solve? And why it works fine on second run?




Aucun commentaire:

Enregistrer un commentaire