1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #5997 from whymarrh/drizzle-script

Harden Drizzle test runner script
This commit is contained in:
Thomas Huang 2019-01-04 08:03:54 -08:00 committed by GitHub
commit 4e0d48244a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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:-}