aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huang <tmashuang@users.noreply.github.com>2019-01-05 00:03:54 +0800
committerGitHub <noreply@github.com>2019-01-05 00:03:54 +0800
commit4e0d48244a78b671087ed5349e4295964f6290c1 (patch)
tree0c641bbb552cb5e8146db0a6dcbdba5b14aaa0da
parentdd6d3232faf84282dd82ed1dc6be0dfbc56592c6 (diff)
parent4d4d4caf78dc5a3c8eaa93e2bc2e7581ac15b6df (diff)
downloadtangerine-wallet-browser-4e0d48244a78b671087ed5349e4295964f6290c1.tar
tangerine-wallet-browser-4e0d48244a78b671087ed5349e4295964f6290c1.tar.gz
tangerine-wallet-browser-4e0d48244a78b671087ed5349e4295964f6290c1.tar.bz2
tangerine-wallet-browser-4e0d48244a78b671087ed5349e4295964f6290c1.tar.lz
tangerine-wallet-browser-4e0d48244a78b671087ed5349e4295964f6290c1.tar.xz
tangerine-wallet-browser-4e0d48244a78b671087ed5349e4295964f6290c1.tar.zst
tangerine-wallet-browser-4e0d48244a78b671087ed5349e4295964f6290c1.zip
Merge pull request #5997 from whymarrh/drizzle-script
Harden Drizzle test runner script
-rwxr-xr-xtest/e2e/beta/run-drizzle.sh33
1 files changed, 24 insertions, 9 deletions
diff --git a/test/e2e/beta/run-drizzle.sh b/test/e2e/beta/run-drizzle.sh
index 09b903afb..0799b5a65 100755
--- a/test/e2e/beta/run-drizzle.sh
+++ b/test/e2e/beta/run-drizzle.sh
@@ -1,16 +1,31 @@
#!/usr/bin/env bash
-export PATH="$PATH:./node_modules/.bin"
+set -e
+set -u
+set -o pipefail
npm run ganache:start -- -b 2 >> /dev/null 2>&1 &
+npm_run_ganache_start_pid=$!
sleep 5
-cd test/e2e/beta/
-rm -rf drizzle-test
-mkdir drizzle-test && cd drizzle-test
-npm install truffle
-../../../../node_modules/.bin/truffle unbox drizzle
+
+pushd "$(mktemp -d)"
+npm install --no-package-lock truffle
+truffle="$(npm bin)/truffle"
+$truffle unbox drizzle
echo "Deploying contracts for Drizzle test..."
-../../../../node_modules/.bin/truffle compile && ../../../../node_modules/.bin/truffle migrate
+$truffle compile
+$truffle migrate
+
BROWSER=none npm start >> /dev/null 2>&1 &
-cd ../../../../
-mocha test/e2e/beta/drizzle.spec
+npm_start_pid=$!
+
+popd
+if ! mocha test/e2e/beta/drizzle.spec
+then
+ test_status=1
+fi
+
+! kill -15 $npm_run_ganache_start_pid
+! kill -15 $npm_start_pid
+! wait $npm_run_ganache_start_pid $npm_start_pid
+exit ${test_status:-}