From 23a5a293a5e53eaf08bc4c9f099b658ad1ead080 Mon Sep 17 00:00:00 2001 From: billy rennekamp Date: Mon, 4 Jul 2022 16:01:23 +0200 Subject: [PATCH] swap out ignite for liveness test (#1574) * swap out ignite for liveness test * force liveness test to run * add min-gas-price * add validator mode flag * show logs * add more logs * add more logs * gopath * more logs * change to build dir * change to pkg * change sed for linux * clean up --- .github/workflows/test.yml | 9 ++++----- Makefile | 10 +++++++++- app/app.go | 2 +- contrib/scripts/test_localnet_liveness.sh | 4 ++++ 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 219e2c3437d..2267c1b5aa8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -89,16 +89,15 @@ jobs: **/**.go go.mod go.sum - - name: Install Ignite CLI + - name: Install Gaia run: | - curl https://get.ignite.com/cli@v0.21.1! | bash + make build if: env.GIT_DIFF - - name: Start Local Network via Ignite CLI + - name: Start Local Network run: | - make start-localnet-ci > ignite.out 2>&1 & + make start-localnet-ci > liveness.out 2>&1 & if: env.GIT_DIFF - name: Test Local Network Liveness run: | - sleep 3m ./contrib/scripts/test_localnet_liveness.sh 100 5 50 localhost if: env.GIT_DIFF diff --git a/Makefile b/Makefile index 14f36947a27..9ae1efd7e2a 100644 --- a/Makefile +++ b/Makefile @@ -222,7 +222,15 @@ format: ############################################################################### start-localnet-ci: - @ignite chain serve --reset-once -v -c ./ignite.ci.yml + ./build/gaiad init liveness --chain-id liveness --home ~/.gaiad-liveness + ./build/gaiad config chain-id liveness --home ~/.gaiad-liveness + ./build/gaiad config keyring-backend test --home ~/.gaiad-liveness + ./build/gaiad keys add val --home ~/.gaiad-liveness + ./build/gaiad add-genesis-account val 10000000000000000000000000stake --home ~/.gaiad-liveness --keyring-backend test + ./build/gaiad gentx val 1000000000stake --home ~/.gaiad-liveness --chain-id liveness + ./build/gaiad collect-gentxs --home ~/.gaiad-liveness + sed -i'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' ~/.gaiad-liveness/config/app.toml + ./build/gaiad start --home ~/.gaiad-liveness --mode validator --x-crisis-skip-assert-invariants .PHONY: start-localnet-ci diff --git a/app/app.go b/app/app.go index c28315d4e83..a352c86185c 100644 --- a/app/app.go +++ b/app/app.go @@ -761,7 +761,7 @@ func NewGaiaApp( ctx.Logger().Info("start to init interchainaccount module...") // initialize ICS27 module icaModule.InitModule(ctx, controllerParams, hostParams) - ctx.Logger().Info("start to run module migrations...") + ctx.Logger().Info("Start to run module migrations...") return app.mm.RunMigrations(ctx, app.configurator, fromVM) }, diff --git a/contrib/scripts/test_localnet_liveness.sh b/contrib/scripts/test_localnet_liveness.sh index 9174b48b667..ce5c85c385b 100755 --- a/contrib/scripts/test_localnet_liveness.sh +++ b/contrib/scripts/test_localnet_liveness.sh @@ -30,10 +30,14 @@ if [ -z "$4" ]; then exit 1 fi +echo "running 'sh test_localnet_liveness.sh iterations=$ITER sleep=$SLEEP num-blocks=$NUMBLOCKS node-address=$NODEADDR'" + docker_containers=($(docker ps -q -f name=umeed --format='{{.Names}}')) while [ ${CNT} -lt $ITER ]; do curr_block=$(curl -s $NODEADDR:26657/status | jq -r '.result.sync_info.latest_block_height') + + tail liveness.out if [ ! -z ${curr_block} ]; then echo "Current block: ${curr_block}"