mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
more tests for pull/backward/forward features
This commit is contained in:
parent
e3e552a131
commit
9f35ef70d1
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user