mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Run server-test and websocket-test first. Show stderr upon abnormal rippled exit
This commit is contained in:
@@ -22,7 +22,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "mocha test/*-test.{js,coffee}"
|
"test": "mocha"
|
||||||
},
|
},
|
||||||
|
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -3,3 +3,6 @@
|
|||||||
--ui tdd
|
--ui tdd
|
||||||
--timeout 10000
|
--timeout 10000
|
||||||
--slow 600
|
--slow 600
|
||||||
|
test/server-test.js
|
||||||
|
test/websocket-test.js
|
||||||
|
test/*-test.{js,coffee}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# flags set in mocha.opts
|
# flags set in mocha.opts
|
||||||
mocha test/*-test.{js,coffee}
|
mocha
|
||||||
@@ -91,7 +91,7 @@ Server.prototype._serverSpawnSync = function() {
|
|||||||
var options = {
|
var options = {
|
||||||
cwd: this.serverPath(),
|
cwd: this.serverPath(),
|
||||||
env: process.env,
|
env: process.env,
|
||||||
stdio: this.quiet ? 'ignore' : 'inherit'
|
stdio: this.quiet ? 'pipe': 'inherit'
|
||||||
};
|
};
|
||||||
|
|
||||||
// Spawn in standalone mode for now.
|
// Spawn in standalone mode for now.
|
||||||
@@ -104,12 +104,24 @@ Server.prototype._serverSpawnSync = function() {
|
|||||||
args.join(" "),
|
args.join(" "),
|
||||||
this.configPath());
|
this.configPath());
|
||||||
|
|
||||||
|
|
||||||
|
var stderr = [];
|
||||||
|
self.child.stderr.on('data', function(buf) { stderr.push(buf); });
|
||||||
|
|
||||||
// By default, just log exits.
|
// By default, just log exits.
|
||||||
this.child.on('exit', function(code, signal) {
|
this.child.on('exit', function(code, signal) {
|
||||||
if (!self.quiet) console.log("server: spawn: server exited code=%s: signal=%s", code, signal);
|
if (!self.quiet) console.log("server: spawn: server exited code=%s: signal=%s", code, signal);
|
||||||
|
|
||||||
self.emit('exited');
|
self.emit('exited');
|
||||||
|
|
||||||
|
// Dump server logs on an abnormal exit
|
||||||
|
if (self.quiet && (!self.stopping)) {
|
||||||
|
process.stderr.write("rippled stderr:\n");
|
||||||
|
for (var i = 0; i < stderr.length; i++) {
|
||||||
|
process.stderr.write(stderr[i]);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
// If could not exec: code=127, signal=null
|
// If could not exec: code=127, signal=null
|
||||||
// If regular exit: code=0, signal=null
|
// If regular exit: code=0, signal=null
|
||||||
// Fail the test if the server has not called "stop".
|
// Fail the test if the server has not called "stop".
|
||||||
|
|||||||
Reference in New Issue
Block a user