Skip to content

Commit

Permalink
swap out ignite for liveness test (#1574)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
okwme committed Jul 4, 2022
1 parent 6536d86 commit 23a5a29
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
4 changes: 4 additions & 0 deletions contrib/scripts/test_localnet_liveness.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit 23a5a29

Please sign in to comment.