Enable test in ci, move pull into start.sh

This commit is contained in:
Ethan Frey 2020-02-03 09:11:13 +01:00
parent 690a93ae59
commit 94a49ed899
2 changed files with 11 additions and 7 deletions

View File

@ -6,6 +6,7 @@ workflows:
- build
- lint
- faucet_docker
- test
jobs:
build:
@ -38,6 +39,9 @@ jobs:
- run:
name: Version information
command: echo "node $(node --version)"; echo "yarn $(yarn --version)"
- run: # start early for less wait time below
command: ./projects/scripts/cosm/start.sh
background: true
- restore_cache:
name: Restore Yarn Package Cache
keys:
@ -50,13 +54,8 @@ jobs:
key: yarn-packages-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn
- run:
command: docker pull cosmwasm/wasmd:latest
- run:
command: ./projects/scripts/cosm/start.sh
background: true
- run:
command: sleep 15
- run: # wait until cosm scripts have fully started
command: timeout 15 bash -c "until curl -s http://localhost:1317/node_info > /dev/null; do sleep 1; done
- run:
environment: COSMOS_ENABLED=1
command: yarn test

View File

@ -15,6 +15,10 @@ echo "Using temporary dir $TMP_DIR"
WASMD_LOGFILE="$TMP_DIR/wasmd.log"
REST_SERVER_LOGFILE="$TMP_DIR/rest-server.log"
# pull the newest copy of the docker image
# this is important as the sleep timeout below will fail on first run (downloading entire docker stack usually > 10s)
docker pull "$REPOSITORY:$VERSION"
# This starts up wasmd
docker volume rm -f wasmd_data
docker run --rm \
@ -36,6 +40,7 @@ if [ "$(docker inspect -f '{{.State.Running}}' "$CONTAINER_NAME")" != "true" ];
echo "Container named '$CONTAINER_NAME' not running. We cannot continue." \
"This can happen when 'docker run' needs too long to download and start." \
"It might be worth retrying this step once the image is in the local docker cache."
docker kill "$CONTAINER_NAME"
exit 1
fi