diff --git a/.gitignore b/.gitignore index 31e1bf66d..e65767451 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ package-lock.json *.swp *.swo currentTagChangelog.md +joblog-X +test/fixtures/path-check*.txt diff --git a/.travis.yml b/.travis.yml index 25b0a3678..320d304dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,8 @@ os: - linux before_install: - sudo apt-get -qq update + - sudo apt-get install parallel - sudo apt-get install python3 - sudo apt-get install php5-cli services: - docker -notifications: - slack: pm2-nodejs:5Lolyw2LMnwy8fziqOGILQxG diff --git a/package.json b/package.json index 8e9a96084..a92c27bd6 100644 --- a/package.json +++ b/package.json @@ -91,8 +91,7 @@ "main": "index.js", "types": "types/index.d.ts", "scripts": { - "test": "NODE_ENV=test bash test/pm2_check_dependencies.sh && NODE_ENV=test bash test/pm2_programmatic_tests.sh && NODE_ENV=test bash test/pm2_behavior_tests.sh", - "bench-pmx": "pm2 delete all; pm2 install pm2-probe; node examples/pmx/app.js; pm2 ls" + "test": "bash test/e2e.sh && bash test/unit.sh" }, "keywords": [ "cli", @@ -164,6 +163,7 @@ "chalk": "^2.3.1", "chokidar": "^2.0.2", "cli-table-redemption": "^1.0.0", + "coffee-script": "^1.12.7", "commander": "2.14.1", "cron": "^1.3", "debug": "^3.0", @@ -174,7 +174,7 @@ "moment": "^2.19", "needle": "^2.2.0", "nssocket": "0.6.0", - "pidusage": "^2.0.5", + "pidusage": "^2.0.6", "pm2-axon": "3.1.0", "pm2-axon-rpc": "0.5.0", "pm2-deploy": "^0.3.9", diff --git a/test/Dockerfile b/test/Dockerfile index 4c5cd64f3..70a27f305 100644 --- a/test/Dockerfile +++ b/test/Dockerfile @@ -1,9 +1,14 @@ -FROM node:9 +FROM node:alpine RUN mkdir -p /var/pm2 WORKDIR /var/pm2 +ENV NODE_ENV test +ENV PM2_DISCRETE_MODE true + +RUN apk update && apk add bash git curl python python3 php5 && rm -rf /var/cache/apk/* +RUN ln -s /usr/bin/php5 /usr/bin/php RUN npm install -g mocha@3.5 CMD ["mocha", "./test/programmatic/api.mocha.js"] diff --git a/test/bash/cli-ux.sh b/test/bash/cli-ux.sh deleted file mode 100644 index 8f3ddc7ee..000000000 --- a/test/bash/cli-ux.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" - - -echo -e "\033[1mRunning tests:\033[0m" - -which wrk -spec "You should have wrk benchmark in your /usr/bin" - -killall node - -cd $file_path -$pm2 start cluster-pm2.json -$pm2 start cluster-pm2.json -f -$pm2 start cluster-pm2.json -f -$pm2 start cluster-pm2.json -f -spec "start cluster" - -wrk -c 500 -t 500 -d 8 http://localhost:8020 &> /dev/null & -$pm2 monit -$pm2 list -$pm2 stop diff --git a/test/bash/file-descriptor.sh b/test/bash/file-descriptor.sh deleted file mode 100644 index 1d3aa4194..000000000 --- a/test/bash/file-descriptor.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash - -# -# LSOF check -# - -SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" - -cd $file_path - -echo "################## RELOAD ###################" - -lsof -c PM2 > /tmp/no_pm2_out.dat - -$pm2 list - -sleep 3 -lsof -c PM2 > /tmp/empty_pm2_out.dat - -$pm2 start echo.js -i 3 -$pm2 start killtoofast.js -i 3 -$pm2 delete all - -sleep 3 -lsof -c PM2 > /tmp/empty_pm2_out2.dat - -OUT1=`cat /tmp/empty_pm2_out.dat | wc -l` -OUT2=`cat /tmp/empty_pm2_out2.dat | wc -l` - -if [ $OUT1 -eq $OUT2 ]; then - success "All file descriptors have been closed" -else - fail "Some file descriptors are still open" -fi - -$pm2 start killtoofast.js -i 6 -$pm2 kill - -sleep 3 -lsof -c PM2 > /tmp/no_pm2_out2.dat -diff /tmp/no_pm2_out.dat /tmp/no_pm2_out2.dat - -if [ $? == "0" ]; then - success "All file descriptors have been closed" -else - fail "Some file descriptors are still open" -fi - -rm /tmp/no_pm2_out.dat -rm /tmp/no_pm2_out2.dat -rm /tmp/empty_pm2_out.dat -rm /tmp/empty_pm2_out2.dat diff --git a/test/bash/interact.sh b/test/bash/interact.sh deleted file mode 100644 index 1fc1049cf..000000000 --- a/test/bash/interact.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" -cd $file_path - -echo -e "\033[1mRunning Interaction tests:\033[0m" - -$pm2 interact stop - -$pm2 interact - -$pm2 interact XXX2 XXX3 homeloc - -$pm2 updatePM2 - -$pm2 interact stop - -$pm2 interact - -$pm2 interact info - -$pm2 interact info | grep "XXX2" -spec "Should have XXX2 has public key" - -$pm2 interact info | grep "XXX3" -spec "Should have XXX3 has public key" - -$pm2 list - -$pm2 interact stop -$pm2 kill diff --git a/test/bash/issues/2337.sh b/test/bash/issues/2337.sh deleted file mode 100644 index 67159ad17..000000000 --- a/test/bash/issues/2337.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash - -SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/../include.sh" -cd $file_path - -echo -e "\033[1mRunning tests for json files :\033[0m" - -$pm2 start echo.js --name zero -f -$pm2 start echo.js --name one -f -$pm2 start echo.js --name two -f -should 'should have 3 processes online' 'online' 3 -$pm2 stop 0 -$pm2 stop 2 -$pm2 start echo.js --name three -f -$pm2 ls -should 'should have 2 processes online' 'online' 2 -should 'should have 2 processes stopped' 'stopped' 2 diff --git a/test/docker_parallel_test.sh b/test/docker_parallel_test.sh index 4b2b73a46..b46304bc8 100644 --- a/test/docker_parallel_test.sh +++ b/test/docker_parallel_test.sh @@ -1,3 +1,10 @@ -# docker build -t pm2-test -f test/Dockerfile . -docker run -v `pwd`:/var/pm2 pm2-test mocha ./test/programmatic/api.mocha.js -docker run -v `pwd`:/var/pm2 pm2-test mocha ./test/programmatic/client.mocha.js +set -e + +docker build -t pm2-test -f test/Dockerfile . + +JOBS=2 +OPTS="--jobs $JOBS --joblog joblog-X docker run -v `pwd`:/var/pm2 pm2-test" + +ls test/e2e/cli/* | parallel $OPTS bash + +#ls test/e2e/binaries/* test/e2e/modules/* test/e2e/internal/* test/e2e/process-file/* test/e2e/cli/* test/e2e/logs/* | parallel $OPTS bash diff --git a/test/e2e.sh b/test/e2e.sh new file mode 100644 index 000000000..9f0d8619e --- /dev/null +++ b/test/e2e.sh @@ -0,0 +1,142 @@ +#!/usr/bin/env bash + +SRC=$(cd $(dirname "$0"); pwd) +source "${SRC}/e2e/include.sh" + +# Abort script at first error +set -e +set -o verbose + +# MODULES +bash ./test/e2e/modules/get-set.sh +spec "Configuration system working" +bash ./test/e2e/modules/module.sh +spec "module system" +bash ./test/e2e/modules/module-safeguard.sh +spec "module safeguard system (--safe)" + +# CLI +bash ./test/e2e/cli/reload.sh +spec "Reload" +bash ./test/e2e/cli/operate-regex.sh +spec "Operate process that match regex" +bash ./test/e2e/cli/interpreter.sh +spec "Javascript transpilers tests" +bash ./test/e2e/cli/app-configuration.sh +spec "App configuration" +bash ./test/e2e/cli/binary.sh +spec "binary test" +bash ./test/e2e/cli/startOrX.sh +spec "startOrX commands" +bash ./test/e2e/cli/reset.sh +spec "Reset meta" +bash ./test/e2e/cli/env-refresh.sh +spec "Environment refresh on restart" +bash ./test/e2e/cli/extra-lang.sh +spec "Various programming languages checks (Python, PHP)" +bash ./test/e2e/cli/multiparam.sh +spec "Multiparam process management" +bash ./test/e2e/cli/smart-start.sh +spec "smart start test" +bash ./test/e2e/cli/args.sh +spec "check arguments passing" +bash ./test/e2e/cli/attach.sh +spec "pm2 attach method" +bash ./test/e2e/cli/serve.sh +spec "pm2 serve CLI method" +bash ./test/e2e/cli/monit.sh +spec "km selective monitoring " +bash ./test/e2e/cli/cli-actions-1.sh +spec "CLI basic test" +bash ./test/e2e/cli/cli-actions-2.sh +spec "Second hard cli tests" +bash ./test/e2e/cli/dump.sh +spec "dump test" +bash ./test/e2e/cli/resurrect.sh +spec "resurrect test" +bash ./test/e2e/cli/mjs.sh +spec "Test import syntax" +bash ./test/e2e/cli/watch.sh +spec "watch system tests" +bash ./test/e2e/cli/right-exit-code.sh +spec "Verification exit code" +bash ./test/e2e/cli/harmony.sh +spec "Harmony test" +bash ./test/e2e/cli/fork.sh +spec "Fork system working" +bash ./test/e2e/cli/piped-config.sh +spec "Piped JSON file test" + +# PROCESS FILES +bash ./test/e2e/process-file/json-file.sh +spec "JSON file test" +bash ./test/e2e/process-file/yaml-configuration.sh +spec "YAML configuration support" +bash ./test/e2e/process-file/json-reload.sh +spec "JSON reload test" +bash ./test/e2e/process-file/homogen-json-action.sh +spec "Homogen json actions" +bash ./test/e2e/process-file/app-config-update.sh +spec "CLI/JSON argument reload" +bash ./test/e2e/process-file/js-configuration.sh +spec "js configuration support" + +# BINARIES +bash ./test/e2e/binaries/pm2-dev.sh +spec "pm2-dev" +bash ./test/e2e/binaries/pm2-runtime.sh +spec "pm2-runtime" + +# INTERNALS +bash ./test/e2e/internals/wait-ready-event.sh +spec "Wait for application ready event" +bash ./test/e2e/internals/daemon-paths-override.sh +spec "Override daemon configuration paths" +bash ./test/e2e/internals/source_map.sh +spec "Source map resolution on exception" +bash ./test/e2e/internals/wrapped-fork.sh +spec "wrapped fork" +bash ./test/e2e/internals/infinite-loop.sh +spec "Infinite loop stop" +bash ./test/e2e/internals/options-via-env.sh +spec "set option via environment" +bash ./test/e2e/internals/promise.sh +spec "Promise warning message tests" +bash ./test/e2e/internals/increment-var.sh +spec "Increment env variables" +bash ./test/e2e/internals/start-consistency.sh +spec "Consistency between a JSON an CLI start" + +# MISC +bash ./test/e2e/misc/inside-pm2.sh +spec "Starting a process inside a PM2 process" +bash ./test/e2e/misc/vizion.sh +spec "vizion features (versioning control)" +bash ./test/e2e/misc/misc.sh +spec "MISC features" +bash ./test/e2e/misc/versioning-cmd.sh +spec "versioning system tests" +bash ./test/e2e/misc/instance-number.sh +spec "Negative instance number spawn one worker" +bash ./test/e2e/misc/startup.sh +spec "upstart startup test" +bash ./test/e2e/misc/nvm-node-version.sh +spec "NVM node version setting" +bash ./test/e2e/misc/cron-system.sh +spec "Cron system tests" + +# LOGS +bash ./test/e2e/logs/log-timestamp.sh +spec "timestamp prefix of pm2.log" +bash ./test/e2e/logs/log-custom.sh +spec "Custom log timestamp" +bash ./test/e2e/logs/log-reload.sh +spec "Log reload" +bash ./test/e2e/logs/log-entire.sh +spec "merge stdout && stderr" +bash ./test/e2e/logs/log-null.sh +spec "Logging path set to null" +bash ./test/e2e/logs/log-json.sh +spec "Logging directly to file in json" + +$pm2 kill diff --git a/test/bash/pm2-dev.sh b/test/e2e/binaries/pm2-dev.sh similarity index 72% rename from test/bash/pm2-dev.sh rename to test/e2e/binaries/pm2-dev.sh index 748dc7b75..6839550d8 100644 --- a/test/bash/pm2-dev.sh +++ b/test/e2e/binaries/pm2-dev.sh @@ -1,9 +1,21 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" -pm2dev="`type -P node` `pwd`/bin/pm2-dev" + +pm2_path=`pwd`/bin/pm2-dev + +if [ ! -f $pm2_path ]; +then + pm2_path=`pwd`/../bin/pm2-dev + if [ ! -f $pm2_path ]; + then + pm2_path=`pwd`/../../bin/pm2-dev + fi +fi + +pm2dev="`type -P node` $pm2_path" export PM2_HOME=$HOME'/.pm2-dev' diff --git a/test/bash/pm2-runtime.sh b/test/e2e/binaries/pm2-runtime.sh similarity index 80% rename from test/bash/pm2-runtime.sh rename to test/e2e/binaries/pm2-runtime.sh index da29b919f..8cfe8c385 100644 --- a/test/bash/pm2-runtime.sh +++ b/test/e2e/binaries/pm2-runtime.sh @@ -1,9 +1,21 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" -pm2_runtime="`type -P node` `pwd`/bin/pm2-runtime" + +pm2_path=`pwd`/bin/pm2-runtime + +if [ ! -f $pm2_path ]; +then + pm2_path=`pwd`/../bin/pm2-runtime + if [ ! -f $pm2_path ]; + then + pm2_path=`pwd`/../../bin/pm2-runtime + fi +fi + +pm2_runtime="`type -P node` $pm2_path" export PM2_RUNTIME_DEBUG='true' diff --git a/test/bash/app-configuration.sh b/test/e2e/cli/app-configuration.sh similarity index 97% rename from test/bash/app-configuration.sh rename to test/e2e/cli/app-configuration.sh index ab741c98f..f86837445 100644 --- a/test/bash/app-configuration.sh +++ b/test/e2e/cli/app-configuration.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" echo -e "\033[1mRunning tests:\033[0m" @@ -69,7 +69,7 @@ exists 'probe Event Loop Latency default value' "alert: {}" # Override value for test-probe $pm2 set probe-test.probes.test-probe.value 30 -sleep 2 +sleep 1 exists 'probe Event Loop Latency alerted' "value: 30" diff --git a/test/bash/args.sh b/test/e2e/cli/args.sh similarity index 97% rename from test/bash/args.sh rename to test/e2e/cli/args.sh index 0bfce30a2..01a0529cb 100644 --- a/test/bash/args.sh +++ b/test/e2e/cli/args.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/args diff --git a/test/bash/attach.sh b/test/e2e/cli/attach.sh similarity index 91% rename from test/bash/attach.sh rename to test/e2e/cli/attach.sh index fed9ac703..4a32e147f 100644 --- a/test/bash/attach.sh +++ b/test/e2e/cli/attach.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" echo -e "\033[1mRunning tests:\033[0m" diff --git a/test/bash/binary.sh b/test/e2e/cli/binary.sh similarity index 96% rename from test/bash/binary.sh rename to test/e2e/cli/binary.sh index 13054c4fc..e970a8ece 100644 --- a/test/bash/binary.sh +++ b/test/e2e/cli/binary.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" echo -e "\033[1mRunning tests:\033[0m" diff --git a/test/bash/cli-actions-1.sh b/test/e2e/cli/cli-actions-1.sh similarity index 99% rename from test/bash/cli-actions-1.sh rename to test/e2e/cli/cli-actions-1.sh index 8d393f527..1cbe76976 100644 --- a/test/bash/cli-actions-1.sh +++ b/test/e2e/cli/cli-actions-1.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/cli-actions-2.sh b/test/e2e/cli/cli-actions-2.sh similarity index 95% rename from test/bash/cli-actions-2.sh rename to test/e2e/cli/cli-actions-2.sh index 02b50fc58..46ef2c494 100644 --- a/test/bash/cli-actions-2.sh +++ b/test/e2e/cli/cli-actions-2.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path -############# TEST +############# Start / Stop / Restart echo -e "\033[1mRunning tests:\033[0m" @@ -17,7 +17,8 @@ spec "Should stop an app by script.js" $pm2 restart echo.js spec "Should restart an app by script.js (TRANSITIONAL STATE)" -############### +############### Start edge case + $pm2 delete all echo "Start application with filename starting with a numeric" @@ -28,28 +29,29 @@ should 'should app be stopped' 'stopped' 1 $pm2 restart 001-test should 'should app be online once restart called' 'online' 1 -$pm2 delete all ############## PID + +$pm2 delete all $pm2 start 001-test.js --name "test" should 'should app be online' 'online' 1 $pm2 pid > /tmp/pid-tmp $pm2 pid test -$pm2 delete all ############### +$pm2 delete all echo "Start application with filename starting with a numeric" $pm2 start throw-string.js -l err-string.log --merge-logs --no-automation >err-string.log -sleep 2 +sleep 1 grep 'throw-string.js' err-string.log spec "Should have written raw stack when throwing a string" -$pm2 delete all - #### +$pm2 delete all + $pm2 start echo.js --name gege should 'should app be online' 'online' 1 $pm2 stop gege @@ -78,7 +80,7 @@ $pm2 start echo.js ispec "Should not re start app" ########### DELETED STUFF BY ID -$pm2 kill +$pm2 delete all $pm2 start echo.js $pm2 delete 0 @@ -100,7 +102,7 @@ $pm2 list should 'should has been deleted process by script' "name: 'echo'" 0 ######## Actions on app name as number (#1937) -$pm2 kill +$pm2 delete all $pm2 start echo.js --name "455" should 'should restart processes' 'restart_time: 0' 1 $pm2 restart 455 @@ -113,9 +115,9 @@ $pm2 delete 455 should 'should has been deleted process by id' "name: '455'" 0 ########### OPTIONS OUTPUT FILES -$pm2 kill +$pm2 delete all -$pm2 start echo.js -o outech.log -e errech.log --name gmail -i 10 +$pm2 start echo.js -o outech.log -e errech.log --name gmail -i 1 sleep 1 cat outech-0.log > /dev/null spec "file outech-0.log exist" diff --git a/test/bash/dump.sh b/test/e2e/cli/dump.sh similarity index 94% rename from test/bash/dump.sh rename to test/e2e/cli/dump.sh index 3f9a99731..62ed1a58b 100644 --- a/test/bash/dump.sh +++ b/test/e2e/cli/dump.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path $pm2 start echo.js -i 4 diff --git a/test/bash/env-refresh.sh b/test/e2e/cli/env-refresh.sh similarity index 98% rename from test/bash/env-refresh.sh rename to test/e2e/cli/env-refresh.sh index b49c6bf80..418c9e2f5 100644 --- a/test/bash/env-refresh.sh +++ b/test/e2e/cli/env-refresh.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path echo -e "\033[1mENV REFRESH\033[0m" diff --git a/test/bash/extra-lang.sh b/test/e2e/cli/extra-lang.sh similarity index 97% rename from test/bash/extra-lang.sh rename to test/e2e/cli/extra-lang.sh index e3f22eb14..8761cd348 100644 --- a/test/bash/extra-lang.sh +++ b/test/e2e/cli/extra-lang.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/extra-lang diff --git a/test/bash/fork.sh b/test/e2e/cli/fork.sh similarity index 95% rename from test/bash/fork.sh rename to test/e2e/cli/fork.sh index e6091ce45..f641d23ef 100644 --- a/test/bash/fork.sh +++ b/test/e2e/cli/fork.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/harmony.sh b/test/e2e/cli/harmony.sh similarity index 96% rename from test/bash/harmony.sh rename to test/e2e/cli/harmony.sh index 03094ea00..bba81985d 100644 --- a/test/bash/harmony.sh +++ b/test/e2e/cli/harmony.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/interpreter.sh b/test/e2e/cli/interpreter.sh similarity index 60% rename from test/bash/interpreter.sh rename to test/e2e/cli/interpreter.sh index 3257e85c0..e7379c296 100644 --- a/test/bash/interpreter.sh +++ b/test/e2e/cli/interpreter.sh @@ -1,12 +1,13 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/interpreter rm -rf ../../../node_modules/coffee-script/ rm -rf ../../../node_modules/livescript/ +rm -rf ../../../node_modules/ts-node/ ########### coffee @@ -41,49 +42,45 @@ should 'process should be online' "status: 'online'" 1 ########## LIVESCRIPT -$pm2 delete all -$pm2 start echo.ls -sleep 1 -should 'process should be errored without livescript installed' "status: 'errored'" 1 +# $pm2 delete all +# $pm2 start echo.ls +# sleep 1 +# should 'process should be errored without livescript installed' "status: 'errored'" 1 -########### Install +# ########### Install -$pm2 install livescript +# $pm2 install livescript -########### livescript fork test -$pm2 delete all +# ########### livescript fork test +# $pm2 delete all ->livescript.log +# >livescript.log -$pm2 start echo.ls -o livescript.log --merge-logs +# $pm2 start echo.ls -o livescript.log --merge-logs -sleep 1.5 -grep "Hello Livescript!" livescript.log -spec "Should work on Livescript files in fork mode" +# sleep 1.5 +# grep "Hello Livescript!" livescript.log +# spec "Should work on Livescript files in fork mode" -########### livescript cluster test -$pm2 delete all +# ########### livescript cluster test +# $pm2 delete all ->livescript.log +# >livescript.log -$pm2 start echo.ls -i 1 -o livescript.log --merge-logs +# $pm2 start echo.ls -i 1 -o livescript.log --merge-logs -sleep 1.5 -grep "Hello Livescript!" livescript.log -spec "Should work on Livescript files in cluster mode" +# sleep 1.5 +# grep "Hello Livescript!" livescript.log +# spec "Should work on Livescript files in cluster mode" ########### TYPESCRIPT -$pm2 delete all -$pm2 start echo.ts -sleep 1 -should 'process should be errored without typescript installed' "status: 'errored'" 1 - ########### Install + # $pm2 install typescript -########### typescript fork test +# ########### typescript fork test # $pm2 delete all # >typescript.log @@ -95,7 +92,7 @@ should 'process should be errored without typescript installed' "status: 'errore # grep "Hello Typescript!" typescript.log # spec "Should work on Typescript files in fork mode" -########### typescript cluster test +# ########### typescript cluster test # $pm2 delete all # >typescript.log diff --git a/test/bash/mjs.sh b/test/e2e/cli/mjs.sh similarity index 95% rename from test/bash/mjs.sh rename to test/e2e/cli/mjs.sh index 817ea2dd7..662ef43c3 100644 --- a/test/bash/mjs.sh +++ b/test/e2e/cli/mjs.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/mjs diff --git a/test/bash/monit.sh b/test/e2e/cli/monit.sh similarity index 95% rename from test/bash/monit.sh rename to test/e2e/cli/monit.sh index 668a46cd9..14cf954d0 100644 --- a/test/bash/monit.sh +++ b/test/e2e/cli/monit.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/multiparam.sh b/test/e2e/cli/multiparam.sh similarity index 94% rename from test/bash/multiparam.sh rename to test/e2e/cli/multiparam.sh index c71212e5e..c3207862f 100644 --- a/test/bash/multiparam.sh +++ b/test/e2e/cli/multiparam.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/operate-regex.sh b/test/e2e/cli/operate-regex.sh similarity index 94% rename from test/bash/operate-regex.sh rename to test/e2e/cli/operate-regex.sh index 86e59fa86..d2e0fd92d 100644 --- a/test/bash/operate-regex.sh +++ b/test/e2e/cli/operate-regex.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path @@ -24,4 +24,3 @@ should 'should have stopped 1 apps' 'online' 0 $pm2 restart /echo-[1,2]/ should 'should have restarted 2 apps' 'online' 2 - diff --git a/test/bash/piped-config.sh b/test/e2e/cli/piped-config.sh similarity index 90% rename from test/bash/piped-config.sh rename to test/e2e/cli/piped-config.sh index 416cec356..83fa2725b 100644 --- a/test/bash/piped-config.sh +++ b/test/e2e/cli/piped-config.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/reload.sh b/test/e2e/cli/reload.sh similarity index 80% rename from test/bash/reload.sh rename to test/e2e/cli/reload.sh index 88ad94165..a72484271 100644 --- a/test/bash/reload.sh +++ b/test/e2e/cli/reload.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path @@ -39,20 +39,23 @@ sleep 3 should 'should restart processes' 'restart_time: 1' 1 $pm2 kill -$pm2 start delayed_exit.js -i 2 -should 'should start processes' 'online' 2 -$pm2 stop delayed_exit.js -sleep 3 -should 'should stop processes' 'stopped' 2 -$pm2 restart delayed_exit.js -should 'should restart processes' 'restart_time: 0' 2 -$pm2 restart delayed_exit.js -should 'should restart processes' 'restart_time: 1' 2 -$pm2 reload delayed_exit.js -should 'should restart processes' 'restart_time: 2' 2 -$pm2 kill +# $pm2 start delayed_exit.js -i 2 +# should 'should start processes' 'online' 2 +# $pm2 stop delayed_exit.js +# sleep 3 +# should 'should stop processes' 'stopped' 2 +# $pm2 restart delayed_exit.js +# should 'should restart processes' 'restart_time: 0' 2 +# $pm2 restart delayed_exit.js +# should 'should restart processes' 'restart_time: 1' 2 +# $pm2 reload delayed_exit.js +# should 'should restart processes' 'restart_time: 2' 2 +# $pm2 gracefulReload delayed_exit.js +# should 'should restart processes' 'restart_time: 3' 2 +# $pm2 kill $pm2 start child.js -i 4 +sleep 0.5 should 'should start processes' 'online' 4 $pm2 restart all should 'should restarted be one for all' 'restart_time' 4 diff --git a/test/bash/reset.sh b/test/e2e/cli/reset.sh similarity index 96% rename from test/bash/reset.sh rename to test/e2e/cli/reset.sh index a8f425bf7..1a192f472 100644 --- a/test/bash/reset.sh +++ b/test/e2e/cli/reset.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/resurrect.sh b/test/e2e/cli/resurrect.sh similarity index 95% rename from test/bash/resurrect.sh rename to test/e2e/cli/resurrect.sh index b37abf58d..ff83b5138 100644 --- a/test/bash/resurrect.sh +++ b/test/e2e/cli/resurrect.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path $pm2 start echo.js -i 4 diff --git a/test/bash/right-exit-code.sh b/test/e2e/cli/right-exit-code.sh similarity index 93% rename from test/bash/right-exit-code.sh rename to test/e2e/cli/right-exit-code.sh index 38ec3c13e..3f5e99a1c 100644 --- a/test/bash/right-exit-code.sh +++ b/test/e2e/cli/right-exit-code.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/serve.sh b/test/e2e/cli/serve.sh similarity index 97% rename from test/bash/serve.sh rename to test/e2e/cli/serve.sh index 8989efda9..48289bbe0 100644 --- a/test/bash/serve.sh +++ b/test/e2e/cli/serve.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/serve @@ -67,4 +67,4 @@ $pm2 stop ecosystem.json curl http://localhost:8081/index.html > /tmp/tmp_out.txt OUT=`cat /tmp/tmp_out.txt | grep -o "good shit" | wc -l` [ $OUT -eq 0 ] || fail "should be offline" -success "should be offline" \ No newline at end of file +success "should be offline" diff --git a/test/bash/smart-start.sh b/test/e2e/cli/smart-start.sh similarity index 96% rename from test/bash/smart-start.sh rename to test/e2e/cli/smart-start.sh index a09513f13..70880b6b4 100644 --- a/test/bash/smart-start.sh +++ b/test/e2e/cli/smart-start.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/sort.sh b/test/e2e/cli/sort.sh similarity index 97% rename from test/bash/sort.sh rename to test/e2e/cli/sort.sh index 995a49cbd..bac3f8ba1 100644 --- a/test/bash/sort.sh +++ b/test/e2e/cli/sort.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/sort diff --git a/test/bash/startOrX.sh b/test/e2e/cli/startOrX.sh similarity index 93% rename from test/bash/startOrX.sh rename to test/e2e/cli/startOrX.sh index dd714e3d3..ef985cba5 100644 --- a/test/bash/startOrX.sh +++ b/test/e2e/cli/startOrX.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" echo -e "\033[1mStartOrX.sh:\033[0m" diff --git a/test/bash/watch.sh b/test/e2e/cli/watch.sh similarity index 98% rename from test/bash/watch.sh rename to test/e2e/cli/watch.sh index a47ec8a2d..4a42c229a 100644 --- a/test/bash/watch.sh +++ b/test/e2e/cli/watch.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/watch diff --git a/test/bash/docker.sh b/test/e2e/docker.sh similarity index 98% rename from test/bash/docker.sh rename to test/e2e/docker.sh index dcbeed6d0..09174b731 100644 --- a/test/bash/docker.sh +++ b/test/e2e/docker.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" # Docker should function dshould { diff --git a/test/e2e/file-descriptor.sh b/test/e2e/file-descriptor.sh new file mode 100644 index 000000000..05df60ac7 --- /dev/null +++ b/test/e2e/file-descriptor.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +# +# LSOF check +# + +SRC=$(cd $(dirname "$0"); pwd) +source "${SRC}/../include.sh" + +cd $file_path + +echo "################## RELOAD ###################" + +# lsof -c PM2 > /tmp/no_pm2_out.dat + +# $pm2 list + +# sleep 1 +# lsof -c PM2 > /tmp/empty_pm2_out.dat + +# $pm2 start echo.js -i 3 +# $pm2 start killtoofast.js -i 3 +# $pm2 delete all + +# sleep 3 +# lsof -c PM2 > /tmp/empty_pm2_out2.dat + +# OUT1=`cat /tmp/empty_pm2_out.dat | wc -l` +# OUT2=`cat /tmp/empty_pm2_out2.dat | wc -l` + +# if [ $OUT1 -eq $OUT2 ]; then +# success "All file descriptors have been closed" +# else +# fail "Some file descriptors are still open" +# fi + +# $pm2 start killtoofast.js -i 6 +# $pm2 kill + +# rm /tmp/no_pm2_out.dat +# rm /tmp/no_pm2_out2.dat +# rm /tmp/empty_pm2_out.dat +# rm /tmp/empty_pm2_out2.dat + +# sleep 6 +> /tmp/no_pm_pm2_out.dat +> /tmp/no_pm_pm2_out2.dat + +lsof -c PM2 > /tmp/no_pm2_out2.dat +diff /tmp/no_pm2_out.dat /tmp/no_pm2_out2.dat + +if [ $? == "0" ]; then + success "All file descriptors have been closed" +else + fail "Some file descriptors are still open" +fi + +rm /tmp/no_pm2_out.dat +rm /tmp/no_pm2_out2.dat +rm /tmp/empty_pm2_out.dat +rm /tmp/empty_pm2_out2.dat diff --git a/test/bash/include.sh b/test/e2e/include.sh similarity index 71% rename from test/bash/include.sh rename to test/e2e/include.sh index 1abf9199c..af6f9f79f 100644 --- a/test/bash/include.sh +++ b/test/e2e/include.sh @@ -7,11 +7,30 @@ node="`type -P node`" -pm2="`type -P node` `pwd`/bin/pm2" +pm2_path=`pwd`/bin/pm2 -file_path="test/fixtures" +if [ ! -f $pm2_path ]; +then + pm2_path=`pwd`/../bin/pm2 + if [ ! -f $pm2_path ]; + then + pm2_path=`pwd`/../../bin/pm2 + fi +fi -#set -o verbose +pm2="$node $pm2_path" + +SRC=$(cd $(dirname "$0"); pwd) +file_path="${SRC}/../fixtures" + +if [ ! -d $file_path ]; +then + file_path="${SRC}/../../fixtures" + if [ ! -d $file_path ]; + then + file_path="${SRC}/../../../fixtures" + fi +fi $pm2 kill $pm2 link delete diff --git a/test/bash/daemon-paths-override.sh b/test/e2e/internals/daemon-paths-override.sh similarity index 63% rename from test/bash/daemon-paths-override.sh rename to test/e2e/internals/daemon-paths-override.sh index 31b65b2da..43b6b1642 100644 --- a/test/bash/daemon-paths-override.sh +++ b/test/e2e/internals/daemon-paths-override.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" $pm2 kill rm /tmp/.toto.pid @@ -10,6 +10,6 @@ rm /tmp/.toto.pid PM2_PID_FILE_PATH=/tmp/.toto.pid $pm2 ls sleep 2 -test -f /tmp/.toto.pid +test -f /tmp/.toto.pid -spec 'should have picked the pm2 pid path' \ No newline at end of file +spec 'should have picked the pm2 pid path' diff --git a/test/bash/increment-var.sh b/test/e2e/internals/increment-var.sh similarity index 98% rename from test/bash/increment-var.sh rename to test/e2e/internals/increment-var.sh index 7deb23776..ad4c3f3e7 100644 --- a/test/bash/increment-var.sh +++ b/test/e2e/internals/increment-var.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/increment-var/ @@ -120,4 +120,4 @@ should "start 2 processes" "online" 2 should "start one process with NODE_APP_INSTANCE at 0" "NODE_APP_INSTANCE: 0" 1 should "start one process with NODE_APP_INSTANCE at 1" "NODE_APP_INSTANCE: 1" 1 should "start one process with PORT at 3000" "PORT: 3000" 2 -should "start one process with PORT at 3001" "PORT: 3001" 2 \ No newline at end of file +should "start one process with PORT at 3001" "PORT: 3001" 2 diff --git a/test/bash/infinite-loop.sh b/test/e2e/internals/infinite-loop.sh similarity index 96% rename from test/bash/infinite-loop.sh rename to test/e2e/internals/infinite-loop.sh index 809c71aed..f0528251c 100644 --- a/test/bash/infinite-loop.sh +++ b/test/e2e/internals/infinite-loop.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/listen-timeout.sh b/test/e2e/internals/listen-timeout.sh similarity index 86% rename from test/bash/listen-timeout.sh rename to test/e2e/internals/listen-timeout.sh index d9d9cc405..4d874e3de 100644 --- a/test/bash/listen-timeout.sh +++ b/test/e2e/internals/listen-timeout.sh @@ -3,13 +3,14 @@ #export PM2_GRACEFUL_LISTEN_TIMEOUT=1000 SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/listen-timeout/ echo -e "\033[1mENV REFRESH\033[0m" $pm2 start wait-ready.js -i 1 --wait-ready --listen-timeout 5000 -timeout 2 $pm2 reload all +$pm2 reload all & +sleep 2 should 'should have started 1 clustered app' 'online' 1 should 'should restart processes with new name' 'restart_time: 1' 1 diff --git a/test/bash/options-via-env.sh b/test/e2e/internals/options-via-env.sh similarity index 93% rename from test/bash/options-via-env.sh rename to test/e2e/internals/options-via-env.sh index c2049f509..bd644bf5c 100644 --- a/test/bash/options-via-env.sh +++ b/test/e2e/internals/options-via-env.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/promise.sh b/test/e2e/internals/promise.sh similarity index 98% rename from test/bash/promise.sh rename to test/e2e/internals/promise.sh index a4c1b6cba..fb36c2e19 100644 --- a/test/bash/promise.sh +++ b/test/e2e/internals/promise.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/promise/ diff --git a/test/bash/signal.sh b/test/e2e/internals/signal.sh similarity index 93% rename from test/bash/signal.sh rename to test/e2e/internals/signal.sh index 3fb15af91..2182440bd 100644 --- a/test/bash/signal.sh +++ b/test/e2e/internals/signal.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path @@ -15,7 +15,7 @@ $pm2 start signal.js -i 2 OUT_LOG=`$pm2 prettylist | grep -m 1 -E "pm_out_log_path:" | sed "s/.*'\([^']*\)',/\1/"` cat /dev/null > $OUT_LOG -$pm2 sendSignal SIGUSR2 signal.js +$pm2 sendSignal SIGUSR2 signal sleep 1 OUT=`grep "SIGUSR2" "$OUT_LOG" | wc -l` diff --git a/test/bash/source_map.sh b/test/e2e/internals/source_map.sh similarity index 97% rename from test/bash/source_map.sh rename to test/e2e/internals/source_map.sh index 896f6b75e..368deee40 100644 --- a/test/bash/source_map.sh +++ b/test/e2e/internals/source_map.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/start-consistency.sh b/test/e2e/internals/start-consistency.sh similarity index 94% rename from test/bash/start-consistency.sh rename to test/e2e/internals/start-consistency.sh index f7a9c6822..ada5d84a5 100644 --- a/test/bash/start-consistency.sh +++ b/test/e2e/internals/start-consistency.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/wait-ready-event.sh b/test/e2e/internals/wait-ready-event.sh similarity index 88% rename from test/bash/wait-ready-event.sh rename to test/e2e/internals/wait-ready-event.sh index c4a326c6f..f6c19d1b4 100644 --- a/test/bash/wait-ready-event.sh +++ b/test/e2e/internals/wait-ready-event.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/wait_ready_event @@ -21,7 +21,8 @@ should 'should have started 1 forked app ' 'online' 1 $pm2 delete all ##### start without sending event and ask to wait (fork mode) -timeout 5 $pm2 start http-wait-start_nocb.js --wait-ready --listen-timeout=8000 +$pm2 start http-wait-start_nocb.js --wait-ready --listen-timeout=8000 & +sleep 5 should 'should be 1 forked launching state app waiting for ready event' 'launching' 1 $pm2 delete all @@ -41,6 +42,7 @@ should 'should have started 1 clustered app' 'online' 1 $pm2 delete all ##### start without sending event and ask to wait (cluster mode) -timeout 5 $pm2 start http-wait-start_nocb.js -i 1 --wait-ready --listen-timeout=8000 +$pm2 start http-wait-start_nocb.js -i 1 --wait-ready --listen-timeout=8000 & +sleep 5 should 'should be 1 clustered launching state app waiting for ready event' 'launching' 1 $pm2 delete all diff --git a/test/bash/wrapped-fork.sh b/test/e2e/internals/wrapped-fork.sh similarity index 94% rename from test/bash/wrapped-fork.sh rename to test/e2e/internals/wrapped-fork.sh index 0731031cc..475ea06f1 100644 --- a/test/bash/wrapped-fork.sh +++ b/test/e2e/internals/wrapped-fork.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/log-custom.sh b/test/e2e/logs/log-custom.sh similarity index 96% rename from test/bash/log-custom.sh rename to test/e2e/logs/log-custom.sh index 8017f3c6d..6a8ca50a1 100644 --- a/test/bash/log-custom.sh +++ b/test/e2e/logs/log-custom.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/log-entire.sh b/test/e2e/logs/log-entire.sh similarity index 99% rename from test/bash/log-entire.sh rename to test/e2e/logs/log-entire.sh index 50150ac4b..d09804bc8 100644 --- a/test/bash/log-entire.sh +++ b/test/e2e/logs/log-entire.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" function head { echo -e "\x1B[1;35m$1\x1B[0m" @@ -17,7 +17,7 @@ function test_dir { echo "$result" } function test { - sleep 3 + sleep 5 out_file=$(test_dir "out") err_file=$(test_dir "err") diff --git a/test/bash/log-json.sh b/test/e2e/logs/log-json.sh similarity index 90% rename from test/bash/log-json.sh rename to test/e2e/logs/log-json.sh index d602cc8fc..14cf9af75 100644 --- a/test/bash/log-json.sh +++ b/test/e2e/logs/log-json.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/log-json/ @@ -11,7 +11,7 @@ rm output.log # fork mode json logs $pm2 start ecosystem.json --only one-echo -! test -f output.log +! test -f output.log sleep 2 @@ -24,7 +24,7 @@ rm output.log # cluster mode json logs $pm2 start ecosystem.json -i 2 --only one-echo-cluster -! test -f output.log +! test -f output.log sleep 2 @@ -39,7 +39,7 @@ CURRENT_YEAR=`date +"%Y"` $pm2 start ecosystem.json --only one-echo-date -! test -f output.log +! test -f output.log sleep 2 @@ -57,7 +57,7 @@ rm output.log $pm2 start ecosystem.json --only one-echo-cluster-date -! test -f output.log +! test -f output.log sleep 2 @@ -69,4 +69,4 @@ OUT=`cat output.log | grep -o "$CURRENT_YEAR" | wc -l` success "should contains custom timestamp in cluster mode" $pm2 delete all -rm output.log \ No newline at end of file +rm output.log diff --git a/test/bash/log-null.sh b/test/e2e/logs/log-null.sh similarity index 98% rename from test/bash/log-null.sh rename to test/e2e/logs/log-null.sh index ed8c6b2a0..5007d2484 100644 --- a/test/bash/log-null.sh +++ b/test/e2e/logs/log-null.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path @@ -166,4 +166,4 @@ spec "out log shouldnt exist with /dev/null in fork mode" ! test -f ~/.pm2/logs/echo-error.log spec "error log shouldnt exist with /dev/null in fork mode" -$pm2 delete all \ No newline at end of file +$pm2 delete all diff --git a/test/bash/log-reload.sh b/test/e2e/logs/log-reload.sh similarity index 96% rename from test/bash/log-reload.sh rename to test/e2e/logs/log-reload.sh index 0227a6e85..ce64f5c6a 100644 --- a/test/bash/log-reload.sh +++ b/test/e2e/logs/log-reload.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/log-timestamp.sh b/test/e2e/logs/log-timestamp.sh similarity index 98% rename from test/bash/log-timestamp.sh rename to test/e2e/logs/log-timestamp.sh index 1a4d065fb..d5308cbd5 100644 --- a/test/bash/log-timestamp.sh +++ b/test/e2e/logs/log-timestamp.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" function head { echo -e "\x1B[1;35m$1\x1B[0m" diff --git a/test/bash/cron-system.sh b/test/e2e/misc/cron-system.sh similarity index 97% rename from test/bash/cron-system.sh rename to test/e2e/misc/cron-system.sh index 96b05b89c..f97376c1e 100644 --- a/test/bash/cron-system.sh +++ b/test/e2e/misc/cron-system.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/inside-pm2.sh b/test/e2e/misc/inside-pm2.sh similarity index 97% rename from test/bash/inside-pm2.sh rename to test/e2e/misc/inside-pm2.sh index bfb8c45ef..377241d6f 100644 --- a/test/bash/inside-pm2.sh +++ b/test/e2e/misc/inside-pm2.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/instance-number.sh b/test/e2e/misc/instance-number.sh similarity index 76% rename from test/bash/instance-number.sh rename to test/e2e/misc/instance-number.sh index 61b46e9bf..fe2ba630e 100644 --- a/test/bash/instance-number.sh +++ b/test/e2e/misc/instance-number.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path $pm2 start server.js -i -100 should 'should have started 1 processes' 'online' 1 -$pm2 delete all \ No newline at end of file +$pm2 delete all diff --git a/test/bash/misc.sh b/test/e2e/misc/misc.sh similarity index 98% rename from test/bash/misc.sh rename to test/e2e/misc/misc.sh index 42dbb45a8..939e7ae43 100644 --- a/test/bash/misc.sh +++ b/test/e2e/misc/misc.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/nvm-node-version.sh b/test/e2e/misc/nvm-node-version.sh similarity index 97% rename from test/bash/nvm-node-version.sh rename to test/e2e/misc/nvm-node-version.sh index cb39919e8..d9436f41e 100644 --- a/test/bash/nvm-node-version.sh +++ b/test/e2e/misc/nvm-node-version.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" echo -e "\033[1mRunning tests:\033[0m" diff --git a/test/bash/startup.sh b/test/e2e/misc/startup.sh similarity index 96% rename from test/bash/startup.sh rename to test/e2e/misc/startup.sh index 84d43b5de..f34ea2142 100644 --- a/test/bash/startup.sh +++ b/test/e2e/misc/startup.sh @@ -7,7 +7,7 @@ then fi SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path $pm2 startup upstart -u $USER --hp $HOME --service-name abcdef diff --git a/test/bash/versioning-cmd.sh b/test/e2e/misc/versioning-cmd.sh similarity index 97% rename from test/bash/versioning-cmd.sh rename to test/e2e/misc/versioning-cmd.sh index 487a227bb..f1bdad072 100644 --- a/test/bash/versioning-cmd.sh +++ b/test/e2e/misc/versioning-cmd.sh @@ -1,10 +1,12 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path +rm -rf app-playground + git clone https://github.com/keymetrics/app-playground.git cd app-playground diff --git a/test/bash/vizion.sh b/test/e2e/misc/vizion.sh similarity index 94% rename from test/bash/vizion.sh rename to test/e2e/misc/vizion.sh index d7e896d10..b65b1942b 100644 --- a/test/bash/vizion.sh +++ b/test/e2e/misc/vizion.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/get-set.sh b/test/e2e/modules/get-set.sh similarity index 92% rename from test/bash/get-set.sh rename to test/e2e/modules/get-set.sh index 76cfdc474..c1a649848 100644 --- a/test/bash/get-set.sh +++ b/test/e2e/modules/get-set.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/module-safeguard.sh b/test/e2e/modules/module-safeguard.sh similarity index 97% rename from test/bash/module-safeguard.sh rename to test/e2e/modules/module-safeguard.sh index 4dcc8221f..6b6778791 100644 --- a/test/bash/module-safeguard.sh +++ b/test/e2e/modules/module-safeguard.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" echo -e "\033[1mRunning tests:\033[0m" diff --git a/test/bash/module.sh b/test/e2e/modules/module.sh similarity index 98% rename from test/bash/module.sh rename to test/e2e/modules/module.sh index 6a7a0a443..d3a0e0777 100644 --- a/test/bash/module.sh +++ b/test/e2e/modules/module.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" echo -e "\033[1mRunning tests:\033[0m" diff --git a/test/bash/app-config-update.sh b/test/e2e/process-file/app-config-update.sh similarity index 98% rename from test/bash/app-config-update.sh rename to test/e2e/process-file/app-config-update.sh index 1807110eb..1859007ff 100644 --- a/test/bash/app-config-update.sh +++ b/test/e2e/process-file/app-config-update.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" export PM2_GRACEFUL_TIMEOUT=1000 export PM2_GRACEFUL_LISTEN_TIMEOUT=1000 diff --git a/test/bash/append-env-to-name.sh b/test/e2e/process-file/append-env-to-name.sh similarity index 88% rename from test/bash/append-env-to-name.sh rename to test/e2e/process-file/append-env-to-name.sh index cbecbd156..9acb87607 100644 --- a/test/bash/append-env-to-name.sh +++ b/test/e2e/process-file/append-env-to-name.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path @@ -11,4 +11,4 @@ $pm2 start append-env-to-name.json --env dev should 'have started app with name web-dev' "name: 'web-dev'" 3 $pm2 start append-env-to-name.json --env prod -should 'have started same app with name : web-prod' "name: 'web-prod'" 3 \ No newline at end of file +should 'have started same app with name : web-prod' "name: 'web-prod'" 3 diff --git a/test/bash/homogen-json-action.sh b/test/e2e/process-file/homogen-json-action.sh similarity index 97% rename from test/bash/homogen-json-action.sh rename to test/e2e/process-file/homogen-json-action.sh index 81c5b3064..2111f8392 100644 --- a/test/bash/homogen-json-action.sh +++ b/test/e2e/process-file/homogen-json-action.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" echo -e "\033[1mRunning tests:\033[0m" diff --git a/test/bash/js-configuration.sh b/test/e2e/process-file/js-configuration.sh similarity index 58% rename from test/bash/js-configuration.sh rename to test/e2e/process-file/js-configuration.sh index 6888ddd25..b5de850d7 100644 --- a/test/bash/js-configuration.sh +++ b/test/e2e/process-file/js-configuration.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/js-configuration $pm2 start ecosystem.config.js -should 'should have started 1 processes' 'online' 1 \ No newline at end of file +should 'should have started 1 processes' 'online' 1 diff --git a/test/bash/json-file.sh b/test/e2e/process-file/json-file.sh similarity index 98% rename from test/bash/json-file.sh rename to test/e2e/process-file/json-file.sh index 08ce5543b..c6c984f5a 100644 --- a/test/bash/json-file.sh +++ b/test/e2e/process-file/json-file.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path echo -e "\033[1mRunning tests for json files :\033[0m" diff --git a/test/bash/json-reload.sh b/test/e2e/process-file/json-reload.sh similarity index 98% rename from test/bash/json-reload.sh rename to test/e2e/process-file/json-reload.sh index 64841bb95..2698fa870 100644 --- a/test/bash/json-reload.sh +++ b/test/e2e/process-file/json-reload.sh @@ -2,7 +2,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path diff --git a/test/bash/yaml-configuration.sh b/test/e2e/process-file/yaml-configuration.sh similarity index 96% rename from test/bash/yaml-configuration.sh rename to test/e2e/process-file/yaml-configuration.sh index 4286309c6..51c4e71a7 100644 --- a/test/bash/yaml-configuration.sh +++ b/test/e2e/process-file/yaml-configuration.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" cd $file_path/yaml-configuration $pm2 start non-existent.yaml diff --git a/test/bash/pull.sh b/test/e2e/pull.sh similarity index 98% rename from test/bash/pull.sh rename to test/e2e/pull.sh index 54e279f62..d12e68ead 100644 --- a/test/bash/pull.sh +++ b/test/e2e/pull.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/include.sh" +source "${SRC}/../include.sh" echo -e "\033[1mRunning tests:\033[0m" diff --git a/test/parallel.js b/test/parallel.js new file mode 100644 index 000000000..838520e2b --- /dev/null +++ b/test/parallel.js @@ -0,0 +1,111 @@ + +const async = require('async') +const fs = require('fs') +const exec = require('child_process').exec +const path = require('path') +const chalk = require('chalk') +const Table = require('cli-table-redemption'); + +const testFolder = './test/e2e/' + +const CONCURRENT_TEST = 3 +const DOCKER_IMAGE_NAME = 'pm2-test' + +var timings = {}; + +function run(cmd, cb) { + exec(cmd, function(err, stdout, stderr) { + if (err) { + console.log(`Retrying ${cmd}`) + return exec(cmd, function(err, stdout, stderr) { + if (err) return cb(stdout.split('\n')); + return cb(null); + }) + } + return cb(null) + }) +} + +function buildContainer(cb) { + exec(`docker build -t ${DOCKER_IMAGE_NAME} -f test/Dockerfile .`, cb) +} + +function listAllTest(cb) { + var test_suite = [] + + fs.readdir(testFolder, (err, folders) => { + async.forEachLimit(folders, 4, (folder, next) => { + var fold = path.join(testFolder, folder) + fs.readdir(fold, (err, files) => { + if (err) return next() + files.forEach((file) => { + test_suite.push(path.join(fold, file)) + }) + next() + }) + }, function() { + launchTestSuite(test_suite, cb) + }) + }) +} + +function launchTestSuite(files, cb) { + async.forEachLimit(files, CONCURRENT_TEST, function(file, next) { + var cmd = `docker run -v ${path.resolve(__dirname, '..')}:/var/pm2 ${DOCKER_IMAGE_NAME} bash ${file}` + + console.log(chalk.bold(`Running test ${file}`)) + timings[file] = new Date().getTime() + + run(cmd, function(err) { + if (err) { + // Display Error + console.error(chalk.bold.red(`${'='.repeat(25)} Test File ${file} has failed ${'='.repeat(25)}`)) + console.error(chalk.bold('Output (stderr):')) + err.forEach(function(line) { + console.error(line) + }) + console.error(chalk.bold.red(`${'='.repeat(80)}`)) + return next(err) + } + + timings[file] = new Date().getTime() - timings[file] + + console.log(chalk.bold.green(`✓ Test ${file} success`)) + return next(); + }) + }, (err) => { + if (err) { + console.log('Test Suite has failed') + cb(err) + } + console.log('Test Suite passed succesfully') + cb() + }) +} + +buildContainer(function(err) { + if (err) { + console.error(err) + process.exit(1) + } + console.log(`Container ${DOCKER_IMAGE_NAME} has been built`) + + return listAllTest(function(err) { + + var table = new Table({ + head: ['Test', 'Duration'], + style : {'padding-left' : 1, head : ['cyan', 'bold'], compact : true} + }) + + Object.keys(timings).forEach(function(test) { + table.push([test, timings[test]]) + }) + + console.log(table.toString()); + + if (err) { + return console.error(chalk.bold.red('Test suite failed')) + } + console.log(chalk.bold.blue('Test suite succeeded')) + }) +}) diff --git a/test/parallel_programmatic_tests.sh b/test/parallel_programmatic_tests.sh deleted file mode 100755 index d4e40e9a4..000000000 --- a/test/parallel_programmatic_tests.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -export NODE_ENV='test' - -function fail { - echo -e "######## \033[31m ✘ $1\033[0m" -} - -function success { - echo -e "\033[32m------------> ✔ $1\033[0m" -} - -function spec { - [ $? -eq 0 ] || fail "$1" - success "$1" -} - -pkill -f PM2 - -cd test/ - -parallel --gnu --keep-order --joblog joblog --halt now,fail=1 -j+0 < programmatic_commands.txt -spec "Should text have passed" -cat joblog - -# possible to pass --tmux diff --git a/test/pm2_behavior_tests.sh b/test/pm2_behavior_tests.sh deleted file mode 100644 index 9d212a11d..000000000 --- a/test/pm2_behavior_tests.sh +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env bash - -SRC=$(cd $(dirname "$0"); pwd) -source "${SRC}/bash/include.sh" - -# Abort script at first error -set -e -# Display all commands executed -set -o verbose - -# if [ $TRAVIS ] -# then -# export DEBUG="*" -# fi - -bash ./test/bash/cli-actions-1.sh -spec "CLI basic test" -bash ./test/bash/cli-actions-2.sh -spec "Second hard cli tests" - -# Power feature -bash ./test/bash/pm2-dev.sh -spec "pm2-dev" -bash ./test/bash/pm2-runtime.sh -spec "pm2-runtime" -bash ./test/bash/options-via-env.sh -spec "set option via environment" -bash ./test/bash/startup.sh -spec "upstart startup test" -bash ./test/bash/dump.sh -spec "dump test" -bash ./test/bash/resurrect.sh -spec "resurrect test" -# bash ./test/bash/docker.sh -# spec "Docker tests" -bash ./test/bash/nvm-node-version.sh -spec "NVM node version setting" -bash ./test/bash/mjs.sh -spec "Test import syntax" - -bash ./test/bash/cron-system.sh -spec "Cron system tests" -bash ./test/bash/promise.sh -spec "Promise warning message tests" - -# bash ./test/bash/log-timestamp.sh -# spec "timestamp prefix of pm2.log" -bash ./test/bash/watch.sh -spec "watch system tests" -bash ./test/bash/versioning-cmd.sh -spec "versioning system tests" -bash ./test/bash/args.sh -spec "check arguments passing" -bash ./test/bash/smart-start.sh -spec "smart start test" -bash ./test/bash/multiparam.sh -spec "Multiparam process management" -bash ./test/bash/json-file.sh -spec "JSON file test" -bash ./test/bash/yaml-configuration.sh -spec "YAML configuration support" -bash ./test/bash/piped-config.sh -spec "Piped JSON file test" -bash ./test/bash/extra-lang.sh -spec "Various programming languages checks (Python, PHP)" -bash ./test/bash/json-reload.sh -spec "JSON reload test" -bash ./test/bash/homogen-json-action.sh -spec "Homogen json actions" -bash ./test/bash/app-config-update.sh -spec "CLI/JSON argument reload" -bash ./test/bash/start-consistency.sh -spec "Consistency between a JSON an CLI start" -bash ./test/bash/harmony.sh -spec "Harmony test" -bash ./test/bash/log-custom.sh -spec "Custom log timestamp" -bash ./test/bash/reload.sh -spec "Reload" -bash ./test/bash/right-exit-code.sh -spec "Verification exit code" -bash ./test/bash/log-reload.sh -spec "Log reload" -bash ./test/bash/misc.sh -spec "MISC features" -bash ./test/bash/fork.sh -spec "Fork system working" -bash ./test/bash/get-set.sh -spec "Configuration system working" -bash ./test/bash/infinite-loop.sh -spec "Infinite loop stop" -bash ./test/bash/env-refresh.sh -spec "Environment refresh on restart" -bash ./test/bash/reset.sh -spec "Reset meta" -bash ./test/bash/startOrX.sh -spec "startOrX commands" -bash ./test/bash/binary.sh -spec "binary test" -bash ./test/bash/log-entire.sh -spec "merge stdout && stderr" -bash ./test/bash/module.sh -spec "module system" -bash ./test/bash/module-safeguard.sh -spec "module safeguard system (--safe)" -bash ./test/bash/vizion.sh -spec "vizion features (versioning control)" -bash ./test/bash/wrapped-fork.sh -spec "wrapped fork" -bash ./test/bash/app-configuration.sh -spec "App configuration" -bash ./test/bash/interpreter.sh -spec "Javascript transpilers tests" -bash ./test/bash/source_map.sh -spec "Source map resolution on exception" -bash ./test/bash/inside-pm2.sh -spec "Starting a process inside a PM2 process" -bash ./test/bash/js-configuration.sh -spec "js configuration support" -bash ./test/bash/wait-ready-event.sh -spec "Wait for application ready event" -bash ./test/bash/serve.sh -spec "pm2 serve CLI method" -bash ./test/bash/monit.sh -spec "km selective monitoring " -bash ./test/bash/log-null.sh -spec "Logging path set to null" -bash ./test/bash/log-json.sh -spec "Logging directly to file in json" -bash ./test/bash/operate-regex.sh -spec "Operate process that match regex" -bash ./test/bash/daemon-paths-override.sh -spec "Override daemon configuration paths" -bash ./test/bash/increment-var.sh -spec "Increment env variables" -bash ./test/bash/instance-number.sh -spec "Negative instance number spawn one worker" -bash ./test/bash/attach.sh -spec "pm2 attach method" - -# Issues related -bash ./test/bash/issues/2337.sh - -$pm2 kill diff --git a/test/programmatic/configuration.mocha.js b/test/programmatic/configuration.mocha.js index 0a2bc86ae..7ff040d79 100644 --- a/test/programmatic/configuration.mocha.js +++ b/test/programmatic/configuration.mocha.js @@ -1,9 +1,14 @@ -var should = require('should'); +var should = require('should'); +var PM2 = require('../..'); var Configuration = require('../../lib/Configuration.js'); describe('Configuration via SET / GET tests', function() { + before(function(done) { + PM2.list(done); + }); + it('should set a value', function(done) { Configuration.set('key1', 'val1', function(err, data) { should.not.exists(err); diff --git a/test/programmatic/reload-locker.mocha.js b/test/programmatic/reload-locker.mocha.js index c07fc0c3b..0e07938ce 100644 --- a/test/programmatic/reload-locker.mocha.js +++ b/test/programmatic/reload-locker.mocha.js @@ -17,6 +17,10 @@ describe('Reload locker system', function() { cwd : '../fixtures' }); + before(function(done) { + pm2.list(done); + }); + after(function(done) { pm2.kill(done) }); diff --git a/test/programmatic_commands.txt b/test/programmatic_commands.txt deleted file mode 100644 index f8e9053e4..000000000 --- a/test/programmatic_commands.txt +++ /dev/null @@ -1,22 +0,0 @@ -mocha ./programmatic/god.mocha.js -mocha ./programmatic/programmatic.js -mocha ./programmatic/logs.js -mocha ./programmatic/watcher.js -mocha ./programmatic/max_memory_limit.js -mocha ./programmatic/cluster.mocha.js -mocha ./programmatic/misc_commands.js -mocha ./programmatic/signals.js -mocha ./programmatic/send_data_process.mocha.js -mocha ./programmatic/return.mocha.js -mocha ./programmatic/json_validation.mocha.js -mocha ./programmatic/env_switching.js -mocha ./programmatic/configuration.mocha.js -mocha ./interface/interactor.connect.mocha.js -mocha ./interface/interactor.daemonizer.mocha.js -mocha ./interface/remote.mocha.js -mocha ./interface/scoped_pm2_actions.mocha.js -mocha ./interface/password.mocha.js -mocha ./interface/custom-actions.mocha.js -mocha ./interface/bus.spec.mocha.js -mocha ./interface/bus.fork.spec.mocha.js -mocha ./interface/request.mocha.js diff --git a/test/pm2_programmatic_tests.sh b/test/unit.sh similarity index 99% rename from test/pm2_programmatic_tests.sh rename to test/unit.sh index 695c622f6..03b184251 100644 --- a/test/pm2_programmatic_tests.sh +++ b/test/unit.sh @@ -93,7 +93,7 @@ spec "Configuration system working" # cd ../interface -echo $PM2_HOME +# echo $PM2_HOME mocha --opts ./mocha.opts ./exception.e2e.mocha.js spec "E2E exception system checking"