2019-12-20 22:37:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -z "$SUBSTRATE_PATH" ]; then
|
|
|
|
echo "Please specify the path to substrate in the SUBSTRATE_PATH environment variable"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f "$SUBSTRATE_PATH" ]; then
|
|
|
|
echo "$SUBSTRATE_PATH doesn't exist"
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Purge dev chain and then spin up the substrate node in background
|
|
|
|
$SUBSTRATE_PATH purge-chain --dev -y
|
2020-01-09 08:44:44 +00:00
|
|
|
$SUBSTRATE_PATH --dev -l debug &
|
2019-12-20 22:37:40 +00:00
|
|
|
SUBSTRATE_PID=$!
|
|
|
|
|
|
|
|
# # Execute tests
|
|
|
|
yarn && yarn test --verbose
|
|
|
|
|
|
|
|
# # Kill the spawned substrate node
|
|
|
|
kill -9 $SUBSTRATE_PID
|