run demo test on circle

This commit is contained in:
Ethan Buchman 2017-02-26 12:52:24 -05:00
parent ce5ecc7db4
commit 0dd5725790
2 changed files with 33 additions and 6 deletions

View File

@ -17,10 +17,11 @@ dependencies:
- go get github.com/Masterminds/glide - go get github.com/Masterminds/glide
- go version - go version
- glide --version - glide --version
- "cd $REPO && glide install" - "cd $REPO && glide install && go install ./cmd/basecoin"
test: test:
override: override:
- "cd $REPO && make test" - "cd $REPO && make test"
- "cd $REPO/demo && bash start.sh"

View File

@ -1,8 +1,27 @@
#! /bin/bash #! /bin/bash
set -eu set -e
cd $GOPATH/src/github.com/tendermint/basecoin/demo cd $GOPATH/src/github.com/tendermint/basecoin/demo
LOG_DIR="."
if [[ "$CIRCLECI" == "true" ]]; then
# set log dir
LOG_DIR="${CIRCLE_ARTIFACTS}"
# install tendermint
set +e
go get github.com/tendermint/tendermint
pushd $GOPATH/src/github.com/tendermint/tendermint
git checkout develop
glide install
go install ./cmd/tendermint
popd
set -e
fi
set -u
function removeQuotes() { function removeQuotes() {
temp="${1%\"}" temp="${1%\"}"
temp="${temp#\"}" temp="${temp#\"}"
@ -14,10 +33,17 @@ function waitForNode() {
set +e set +e
curl -s $addr/status > /dev/null curl -s $addr/status > /dev/null
ERR=$? ERR=$?
i=0
while [ "$ERR" != 0 ]; do while [ "$ERR" != 0 ]; do
if [[ "$i" == 10 ]]; then
echo "waited to long for chain to start"
exit 1
fi
echo "...... still waiting on $addr"
sleep 1 sleep 1
curl -s $addr/status > /dev/null curl -s $addr/status > /dev/null
ERR=$? ERR=$?
i=$((i+1))
done done
set -e set -e
echo "... node $addr is up" echo "... node $addr is up"
@ -51,12 +77,12 @@ echo ""
echo "... starting chains" echo "... starting chains"
echo "" echo ""
# start the first node # start the first node
TMROOT=./data/chain1/tendermint tendermint node &> chain1_tendermint.log & TMROOT=./data/chain1/tendermint tendermint node --skip_upnp --log_level=info &> $LOG_DIR/chain1_tendermint.log &
basecoin start --dir ./data/chain1/basecoin &> chain1_basecoin.log & basecoin start --dir ./data/chain1/basecoin &> $LOG_DIR/chain1_basecoin.log &
# start the second node # start the second node
TMROOT=./data/chain2/tendermint tendermint node --node_laddr tcp://localhost:36656 --rpc_laddr tcp://localhost:36657 --proxy_app tcp://localhost:36658 &> chain2_tendermint.log & TMROOT=./data/chain2/tendermint tendermint node --skip_upnp --log_level=info --node_laddr tcp://localhost:36656 --rpc_laddr tcp://localhost:36657 --proxy_app tcp://localhost:36658 &> $LOG_DIR/chain2_tendermint.log &
basecoin start --address tcp://localhost:36658 --dir ./data/chain2/basecoin &> chain2_basecoin.log & basecoin start --address tcp://localhost:36658 --dir ./data/chain2/basecoin &> $LOG_DIR/chain2_basecoin.log &
echo "" echo ""
echo "... waiting for chains to start" echo "... waiting for chains to start"