90333cc98a
the logs are mostly pointless (because of all '.')
50 lines
1.4 KiB
Bash
Executable File
50 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
export DEBUG=superagent-sync,e2e:*,imap-probe
|
|
export DEBUG_COLORS=true
|
|
|
|
test_pids=()
|
|
|
|
# before
|
|
rm -f logs/*
|
|
echo "Before"
|
|
if ! ./node_modules/.bin/mocha --bail test/before.js > "logs/before.log" 2>&1; then
|
|
echo "Before script failed"
|
|
exit 1
|
|
fi
|
|
|
|
# run tests
|
|
# readonly tests=(app-flow-test app-update-test alt-domain-test cloudron-button-test cloudron-user-test new-user-test cloudron-backup-test cloudron-migrate-test cloudron-autoupdate-sfo1-test cloudron-update-ams3-test selfhost-ec2-test selfhost-digitalocean-test)
|
|
readonly tests=(app-flow-test app-update-test alt-domain-test cloudron-button-test cloudron-user-test new-user-test cloudron-backup-test cloudron-migrate-test cloudron-autoupdate-sfo1-test cloudron-update-ams3-test)
|
|
for t in "${tests[@]}"; do
|
|
EXEC_LOG_FILE="logs/${t}-cloudron-cli.log" ./node_modules/.bin/mocha --bail "test/${t}.js" > "logs/${t}.log" 2>&1 &
|
|
test_pids+=("$!")
|
|
echo "Starting test ${t} with pid ${test_pids[-1]}"
|
|
done
|
|
|
|
# wait for tests to finish
|
|
fail=0
|
|
echo "Waiting for jobs to finish"
|
|
for pid in "${test_pids[@]}"; do
|
|
if ! wait $pid; then
|
|
let "fail+=1"
|
|
echo "$pid failed"
|
|
fi
|
|
done
|
|
|
|
# after
|
|
echo "After"
|
|
if ! ./node_modules/.bin/mocha --bail test/after.js > "logs/after.js" 2>&1; then
|
|
echo "After script failed"
|
|
fi
|
|
|
|
if [ "$fail" == "0" ]; then
|
|
exit 0
|
|
else
|
|
echo "Fail count: ${fail}"
|
|
exit 1
|
|
fi
|
|
|