more verbosity on Interactor when running on Travis

This commit is contained in:
tknew2 2014-11-13 17:55:09 +01:00
parent 2b589d3f51
commit 71c2af2a72
3 changed files with 17 additions and 4 deletions

View File

@ -12,7 +12,7 @@ module.exports = function(God) {
God.lock = function(opts, cb) {
var proc_name = opts.name;
var metadata = opts.meta || {};
var metadata = opts.meta || {};
var processes = God.findByName(opts.name);
var is_locked = false;
var proc_keys = Object.keys(processes);
@ -26,6 +26,8 @@ module.exports = function(God) {
break;
}
console.log('Locking %s', proc.pm2_env.pm_id);
proc.pm2_env.command.locked = true;
proc.pm2_env.command.started_at = Date.now();

View File

@ -177,8 +177,19 @@ var UX = require('../CliUx.js');
InteractorDaemonizer.daemonize = function(infos, cb) {
var InteractorJS = path.resolve(path.dirname(module.filename), 'Daemon.js');
var out = fs.openSync(cst.INTERACTOR_LOG_FILE_PATH, 'a'),
err = fs.openSync(cst.INTERACTOR_LOG_FILE_PATH, 'a');
var out = null;
var err = null;
if (process.env.TRAVIS) {
// Redirect PM2 internal err and out
// to STDERR STDOUT when running with Travis
out = 1;
err = 2;
}
else {
out = fs.openSync(cst.INTERACTOR_LOG_FILE_PATH, 'a');
err = fs.openSync(cst.INTERACTOR_LOG_FILE_PATH, 'a');
}
var child = require('child_process').spawn('node', [InteractorJS], {
silent : false,

View File

@ -172,10 +172,10 @@ describe('Test remote PM2 actions', function() {
it('should act on PM2 but handle failure', function(done) {
send_cmd.once('trigger:pm2:result', function(pck) {
/**
* Once remote command is finished...
*/
should.exist(pck.ret.err);
cmd_pm2.list(function(err, ret) {