2020-09-18 16:50:08 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
export GOPATH=~/go
|
|
|
|
export PATH=$PATH:$GOPATH/bin
|
2020-09-24 17:50:47 +00:00
|
|
|
go build -o ./build/ethermintd ./cmd/ethermintd
|
2020-09-18 16:50:08 +00:00
|
|
|
go build -o ./build/ethermintcli ./cmd/ethermintcli
|
|
|
|
mkdir $GOPATH/bin
|
|
|
|
cp ./build/ethermintd $GOPATH/bin
|
|
|
|
cp ./build/ethermintcli $GOPATH/bin
|
|
|
|
|
2020-09-24 17:50:47 +00:00
|
|
|
CHAINID="ethermint-1337"
|
|
|
|
|
2020-09-18 16:50:08 +00:00
|
|
|
cd tests-solidity
|
|
|
|
|
|
|
|
if command -v yarn &> /dev/null; then
|
2020-09-24 17:50:47 +00:00
|
|
|
yarn install
|
|
|
|
else
|
|
|
|
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
|
|
|
|
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
|
|
|
|
sudo apt update && sudo apt install yarn
|
|
|
|
yarn install
|
2020-09-18 16:50:08 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
chmod +x ./init-test-node.sh
|
|
|
|
./init-test-node.sh > ethermintd.log &
|
|
|
|
sleep 5
|
2021-02-26 21:52:33 +00:00
|
|
|
ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key localkey,user1,user2 --chain-id $CHAINID --trace --wsport 8546 --rpc-api="web3,eth,net,personal" > ethermintcli.log &
|
2020-09-18 16:50:08 +00:00
|
|
|
|
|
|
|
cd suites/initializable
|
|
|
|
yarn test-ethermint
|
|
|
|
|
|
|
|
ok=$?
|
|
|
|
|
|
|
|
if (( $? != 0 )); then
|
2020-09-24 17:50:47 +00:00
|
|
|
echo "initializable test failed: exit code $?"
|
2020-09-18 16:50:08 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
killall ethermintcli
|
|
|
|
killall ethermintd
|
|
|
|
|
|
|
|
echo "Script exited with code $ok"
|
|
|
|
exit $ok
|
|
|
|
|
|
|
|
# initializable-buidler fails on CI, re-add later
|
|
|
|
|
|
|
|
./../../init-test-node.sh > ethermintd.log &
|
|
|
|
sleep 5
|
2021-02-26 21:52:33 +00:00
|
|
|
ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key localkey,user1,user2 --chain-id $CHAINID --trace --wsport 8546 --rpc-api="web3,eth,net,personal" > ethermintcli.log &
|
2020-09-18 16:50:08 +00:00
|
|
|
|
|
|
|
cd ../initializable-buidler
|
|
|
|
yarn test-ethermint
|
|
|
|
|
|
|
|
ok=$(($? + $ok))
|
|
|
|
|
|
|
|
if (( $? != 0 )); then
|
2020-09-24 17:50:47 +00:00
|
|
|
echo "initializable-buidler test failed: exit code $?"
|
2020-09-18 16:50:08 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
killall ethermintcli
|
|
|
|
killall ethermintd
|
|
|
|
|
|
|
|
echo "Script exited with code $ok"
|
|
|
|
exit $ok
|