2018-10-10 07:12:43 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-01-04 13:28:41 +01:00
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
set -o pipefail
|
|
|
|
|
2018-10-10 07:12:43 +02:00
|
|
|
npm run ganache:start -- -b 2 >> /dev/null 2>&1 &
|
2019-01-04 13:37:33 +01:00
|
|
|
npm_run_ganache_start_pid=$!
|
2018-10-10 07:12:43 +02:00
|
|
|
sleep 5
|
2019-01-04 13:37:33 +01:00
|
|
|
|
|
|
|
pushd "$(mktemp -d)"
|
|
|
|
npm install --no-package-lock truffle
|
|
|
|
truffle="$(npm bin)/truffle"
|
|
|
|
$truffle unbox drizzle
|
2018-10-10 07:12:43 +02:00
|
|
|
echo "Deploying contracts for Drizzle test..."
|
2019-01-04 13:37:33 +01:00
|
|
|
$truffle compile
|
|
|
|
$truffle migrate
|
|
|
|
|
2018-10-10 07:12:43 +02:00
|
|
|
BROWSER=none npm start >> /dev/null 2>&1 &
|
2019-01-04 13:37:33 +01:00
|
|
|
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:-}
|