Skip to content

Commit

Permalink
Better error output when setup fails
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanfrey committed Jun 16, 2017
1 parent 4b65d8b commit a20b640
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/cli/basictx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ oneTimeSetUp() {

# start basecoin server (with counter)
initServer $BASE_DIR $CHAIN_ID 3456
PID_SERVER=$!
if [ $? != 0 ]; then return 1; fi

initClient $CHAIN_ID 34567

Expand Down
6 changes: 6 additions & 0 deletions tests/cli/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ initServer() {
echo "Starting ${SERVER_EXE} server..."
${SERVER_EXE} start --home=$SERVE_DIR >>$SERVER_LOG 2>&1 &
sleep 5
PID_SERVER=$!
if ! ps $PID_SERVER >/dev/null; then
echo "**FAILED**"
# cat $SERVER_LOG
# return 1
fi
}

# initClient requires chain_id arg, port is optional (default 46657)
Expand Down
3 changes: 2 additions & 1 deletion tests/cli/counter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ oneTimeSetUp() {

# start basecoin server (with counter)
initServer $BASE_DIR $CHAIN_ID 1234
PID_SERVER=$!
if [ $? != 0 ]; then return 1; fi

initClient $CHAIN_ID 12347
if [ $? != 0 ]; then return 1; fi

echo "...Testing may begin!"
echo
Expand Down
8 changes: 6 additions & 2 deletions tests/cli/ibc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,19 @@ oneTimeSetUp() {

# start basecoin server, giving money to the key in the first client
BC_HOME=${CLIENT_1} initServer $BASE_DIR_1 $CHAIN_ID_1 $PREFIX_1
PID_SERVER_1=$!
if [ $? != 0 ]; then return 1; fi
PID_SERVER_1=$PID_SERVER

# start second basecoin server, giving money to the key in the second client
BC_HOME=${CLIENT_2} initServer $BASE_DIR_2 $CHAIN_ID_2 $PREFIX_2
PID_SERVER_2=$!
if [ $? != 0 ]; then return 1; fi
PID_SERVER_2=$PID_SERVER

# connect both clients
BC_HOME=${CLIENT_1} initClient $CHAIN_ID_1 $PORT_1
if [ $? != 0 ]; then return 1; fi
BC_HOME=${CLIENT_2} initClient $CHAIN_ID_2 $PORT_2
if [ $? != 0 ]; then return 1; fi

echo "...Testing may begin!"
echo
Expand Down

0 comments on commit a20b640

Please sign in to comment.