#2075 add test for pm2-dev / refactor include.sh

This commit is contained in:
Arkotek 2016-04-13 14:37:00 +02:00
parent 652adc2fa7
commit e10f207e65
6 changed files with 29 additions and 20 deletions

View File

@ -1,4 +1,5 @@
var pmx = require('pmx').init({
http : true
});

View File

@ -1,4 +1,3 @@
#!/usr/bin/env bash
SRC=$(cd $(dirname "$0"); pwd)

View File

@ -5,6 +5,16 @@ source "${SRC}/include.sh"
cd $file_path
# Determine wget / curl
which wget > /dev/null
if [ $? -eq 0 ]
then
http_get="wget"
else
echo -e "\033[31mYou need wget to run this test \033[0m";
exit 1;
fi
#
# Different way to stop process
#

View File

@ -1,39 +1,20 @@
#
# cli-test: Tests for god
#
# (C) 2013 Unitech.io Inc.
# MIT LICENSE
#
# Yes, we have tests in bash. How mad science is that?
# export PM2_RPC_PORT=4242
# export PM2_PUB_PORT=4243
node="`type -P node`"
nodeVersion="`$node -v`"
pm2="`type -P node` `pwd`/bin/pm2"
script="echo"
file_path="test/fixtures"
#set -o verbose
$pm2 kill
# Determine wget / curl
which wget > /dev/null
if [ $? -eq 0 ]
then
http_get="wget"
else
echo -e "\033[31mYou need wget to run this test \033[0m";
exit 1;
fi
function fail {
echo -e "######## \033[31m ✘ $1\033[0m"
exit 1

15
test/bash/pm2-dev.sh Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
SRC=$(cd $(dirname "$0"); pwd)
source "${SRC}/include.sh"
pm2dev="`type -P node` `pwd`/bin/pm2-dev"
$pm2 link delete
$pm2dev child.js &
PM2_PID=$!
sleep 2
kill $PM2_PID
spec "should process been killed"

View File

@ -87,4 +87,7 @@ spec "Source map resolution on exception"
bash ./test/bash/inside-pm2.sh
spec "Starting a process inside a PM2 process"
bash ./test/bash/pm2-dev.sh
spec "pm2-dev"
$pm2 kill