mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
#2075 add test for pm2-dev / refactor include.sh
This commit is contained in:
parent
652adc2fa7
commit
e10f207e65
@ -1,4 +1,5 @@
|
||||
|
||||
|
||||
var pmx = require('pmx').init({
|
||||
http : true
|
||||
});
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SRC=$(cd $(dirname "$0"); pwd)
|
||||
|
||||
@ -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
|
||||
#
|
||||
|
||||
@ -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
15
test/bash/pm2-dev.sh
Normal 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"
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user