add test-solidity to github actions, create test script (#510)

This commit is contained in:
noot 2020-09-18 12:50:08 -04:00 committed by GitHub
parent 517de55720
commit 248bcc3008
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 84 additions and 1 deletions

View File

@ -210,3 +210,20 @@ jobs:
run: |
make test-import
if: "env.GIT_DIFF != ''"
test-solidity:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: technote-space/get-diff-action@v3.1
id: git_diff
with:
SUFFIX_FILTER: |
.go
.mod
.sum
- name: test-solidity
run: |
make test-solidity
if: "env.GIT_DIFF != ''"

View File

@ -292,7 +292,11 @@ test-sim-multi-seed-short: runsim
@echo "Running multi-seed application simulation. This may take awhile!"
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 10 TestFullAppSimulation
.PHONY: test test-unit test-race test-import test-rpc test-contract
test-solidity:
@echo "Beginning solidity tests..."
./scripts/run-solidity-tests.sh
.PHONY: test test-unit test-race test-import test-rpc test-contract test-solidity
.PHONY: test-sim-nondeterminism test-sim-custom-genesis-fast test-sim-import-export test-sim-after-import \
test-sim-custom-genesis-multi-seed test-sim-multi-seed-long test-sim-multi-seed-short

View File

@ -396,5 +396,6 @@ func GetMaccPerms() map[string][]string {
for k, v := range maccPerms {
dupMaccPerms[k] = v
}
return dupMaccPerms
}

61
scripts/run-solidity-tests.sh Executable file
View File

@ -0,0 +1,61 @@
#!/bin/bash
export GOPATH=~/go
export PATH=$PATH:$GOPATH/bin
go build -o ./build/ethermintd ./cmd/ethermintd
go build -o ./build/ethermintcli ./cmd/ethermintcli
mkdir $GOPATH/bin
cp ./build/ethermintd $GOPATH/bin
cp ./build/ethermintcli $GOPATH/bin
cd tests-solidity
if command -v yarn &> /dev/null; then
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
fi
chmod +x ./init-test-node.sh
./init-test-node.sh > ethermintd.log &
sleep 5
ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key localkey,user1,user2 --chain-id 1337 --trace --wsport 8546 > ethermintcli.log &
cd suites/initializable
yarn test-ethermint
ok=$?
if (( $? != 0 )); then
echo "initializable test failed: exit code $?"
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
ethermintcli rest-server --laddr "tcp://localhost:8545" --unlock-key localkey,user1,user2 --chain-id 1337 --trace --wsport 8546 > ethermintcli.log &
cd ../initializable-buidler
yarn test-ethermint
ok=$(($? + $ok))
if (( $? != 0 )); then
echo "initializable-buidler test failed: exit code $?"
fi
killall ethermintcli
killall ethermintd
echo "Script exited with code $ok"
exit $ok