mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
added tests for wrapped_fork
This commit is contained in:
parent
6c22eabe61
commit
d5add60bfd
26
test/bash/wrapped_fork.sh
Normal file
26
test/bash/wrapped_fork.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
SRC=$(cd $(dirname "$0"); pwd)
|
||||
source "${SRC}/include.sh"
|
||||
|
||||
cd $file_path
|
||||
|
||||
echo "################## Wrapped fork ###################"
|
||||
|
||||
$pm2 kill
|
||||
|
||||
echo "Testing wrapped fork mode values"
|
||||
|
||||
node path-check.js > path-check1.txt
|
||||
$pm2 start path-check.js -o path-check2.txt
|
||||
sleep 1
|
||||
|
||||
OUT=`diff path-check1.txt path-check2.txt`
|
||||
|
||||
rm path-check1.txt
|
||||
rm path-check2.txt
|
||||
|
||||
[ -z "$OUT" ] || fail "The outputs are not identical"
|
||||
success "The outputs are identical"
|
||||
|
||||
$pm2 kill
|
||||
9
test/fixtures/path-check.js
vendored
Normal file
9
test/fixtures/path-check.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
console.log(__filename);
|
||||
console.log(module.filename);
|
||||
console.log(module.parent);
|
||||
console.log(module.children);
|
||||
console.log(__dirname);
|
||||
console.log(module);
|
||||
console.log(process.env.PWD);
|
||||
console.log(require.main.filename);
|
||||
console.log(require.main === module);
|
||||
@ -69,6 +69,8 @@ bash ./test/bash/module.sh
|
||||
spec "module system"
|
||||
bash ./test/bash/vizion.sh
|
||||
spec "vizion features (versioning control)"
|
||||
bash ./test/bash/wrapped_fork.sh
|
||||
spec "wrapped fork"
|
||||
bash ./test/bash/pmx_injection.sh
|
||||
spec "automatic pmx injection"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user