1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Clean up drizzle test runner script

This commit is contained in:
Whymarrh Whitby 2019-01-04 09:07:33 -03:30
parent 35fbddc5e7
commit 4d4d4caf78

View File

@ -4,17 +4,28 @@ set -e
set -u
set -o pipefail
export PATH="$PATH:./node_modules/.bin"
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:-}