From 9f35ef70d11a37b32d765999fa9fed2c0f17fbd3 Mon Sep 17 00:00:00 2001 From: jshkurti Date: Thu, 6 Nov 2014 17:59:07 +0100 Subject: [PATCH] more tests for pull/backward/forward features --- lib/CLI.js | 3 ++- test/bash/pull.sh | 28 ++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/lib/CLI.js b/lib/CLI.js index 7ad472ce..8679f055 100644 --- a/lib/CLI.js +++ b/lib/CLI.js @@ -1630,7 +1630,8 @@ CLI.forward = function (process_name, cb) { */ function execCommands(repo_path, command_list, cb) { async.eachSeries(command_list, function(command, callback) { - shell.exec('cd '+repo_path+';'+command, function(code, output) { + shell.exec('cd '+repo_path+';'+command, {silent:true}, + function(code, output) { if (code === 0) callback(); else diff --git a/test/bash/pull.sh b/test/bash/pull.sh index 8fc22bce..bba98257 100644 --- a/test/bash/pull.sh +++ b/test/bash/pull.sh @@ -10,28 +10,40 @@ cd $file_path # # Testing pull,forward,backward methods # -git clone https://github.com/Unitech/angular-bridge.git -$pm2 start ./angular-bridge/index.js --name angular +git clone https://github.com/keymetrics/app-playground.git +cd app-playground +git checkout hotfix +$pm2 start ./process.json --name app +sleep 5 + +OUT=`$pm2 ls | grep errored | wc -l` +[ $OUT -eq 1 ] || fail "$1" +success "$1" OUT=`$pm2 desc 0 | grep remote | egrep -oh 'https://([^ ]+)'` -[ $OUT = "https://github.com/Unitech/angular-bridge.git" ] || fail "$1" +[ $OUT = "https://github.com/keymetrics/app-playground.git" ] || fail "$1" success "$1" -OUT=`$pm2 backward angular | wc -l` +OUT=`$pm2 backward app | wc -l` [ $OUT -eq 13 ] || fail "$1" success "$1" -OUT=`$pm2 forward angular | wc -l` +OUT=`$pm2 forward app | wc -l` [ $OUT -eq 13 ] || fail "$1" success "$1" -OUT=`$pm2 forward angular | wc -l` +OUT=`$pm2 forward app | wc -l` [ $OUT -eq 2 ] || fail "$1" success "$1" -OUT=`$pm2 pull angular | wc -l` +OUT=`$pm2 pull app | wc -l` [ $OUT -eq 2 ] || fail "$1" success "$1" +OUT=`$pm2 ls | grep "16 " | wc -l` +[ $OUT -eq 1 ] || fail "$1" +success "$1" + $pm2 kill -rm -rf ./angular-bridge +cd .. +rm -rf ./app-playground