Skip to content

Commit fed0d71

Browse files
committed
add scripts for integration test
Signed-off-by: Jun Kimura <[email protected]>
1 parent c0c58e0 commit fed0d71

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

scripts/run_integration_test.sh

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# A script that runs the integration test with the running nodes
3+
# Prerequisites: scripts/setup_test_nodes.sh is already executed
4+
set -eux
5+
6+
TEST_STORE_DIR=${TEST_STORE_DIR:-data/test}
7+
source ${TEST_STORE_DIR}/binary-channels.env
8+
source ${TEST_STORE_DIR}/binary-chains.env
9+
10+
SETUP_NODES=false TEST_NODE_CHAIN_ID=$CHAIN_ID_A TEST_NODE_RPC_ADDR=$NODE_A_RPC_ADDR TEST_NODE_GRPC_ADDR=$NODE_A_GRPC_ADDR make integration-test

scripts/setup_test_nodes.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# A script that runs two nodes(gaiad) in background and setup IBC connection and channel between the nodes
3+
set -eux
4+
5+
TEST_HEALTH_CHECK_ADDR=${TEST_HEALTH_CHECK_ADDR:-127.0.0.1:7878}
6+
TEST_STORE_DIR=${TEST_STORE_DIR:-data/test}
7+
MAX_ATTEMPTS=${MAX_ATTEMPTS:-60}
8+
RETRY_INTERVAL=${RETRY_INTERVAL:-1}
9+
10+
addr=(${TEST_HEALTH_CHECK_ADDR//:/ })
11+
attempt_num=1
12+
retry_interval=1
13+
14+
TEST_STORE_DIR=${TEST_STORE_DIR} make test-setup-nodes > /dev/null &
15+
16+
until [[ $(nc -d ${addr[0]} ${addr[1]}) == 'ok' ]]
17+
do
18+
if (( attempt_num == MAX_ATTEMPTS )); then
19+
echo "Attempt $attempt_num failed and there are no more attempts left!"
20+
exit 1
21+
else
22+
sleep $RETRY_INTERVAL
23+
attempt_num=$(( $attempt_num+1 ))
24+
fi
25+
26+
done

0 commit comments

Comments
 (0)