aboutsummaryrefslogtreecommitdiffstats
path: root/test/e2e/beta/run-drizzle.sh
blob: 0799b5a65540a4287daa66155a716e91899559f0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash

set -e
set -u
set -o pipefail

npm run ganache:start -- -b 2 >> /dev/null 2>&1 &
npm_run_ganache_start_pid=$!
sleep 5

pushd "$(mktemp -d)"
npm install --no-package-lock truffle
truffle="$(npm bin)/truffle"
$truffle unbox drizzle
echo "Deploying contracts for Drizzle test..."
$truffle compile
$truffle migrate

BROWSER=none npm start >> /dev/null 2>&1 &
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:-}