Skip to content

Commit

Permalink
test(quickstart): wait for server to start, then check for bundled cl…
Browse files Browse the repository at this point in the history
…ient
  • Loading branch information
gr2m committed Jun 5, 2017
1 parent a5b23b2 commit 524276f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/quick-start-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ echo "$ npm start"
npm start & HOODIE_PROCESS=$!

## Give the process a generous sixty seconds to start

RETRIES=60
while [ "$RETRIES" -gt 0 ] ; do
sleep 1
kill -0 $HOODIE_PROCESS 2&>1 > /dev/null || { echo "Hoodie exited prematurely"; wait $HOODIE_PROCESS ; exit $? ; }
curl -fI http://localhost:8080/hoodie/client.js > /dev/null && break
curl -fI http://localhost:8080 > /dev/null && break
let RETRIES=RETRIES-1
done

## Fail if hoodie client cannot be loaded
curl -fI http://localhost:8080/hoodie/client.js > /dev/null

kill $HOODIE_PROCESS

[ $RETRIES -le 0 ] && { echo "Timed out waiting for hoodie to start"; exit 1 ; }
Expand Down

0 comments on commit 524276f

Please sign in to comment.