overleaf/services/web/test/acceptance/scripts/full-test.sh

41 lines
665 B
Bash
Raw Normal View History

#! /usr/bin/env bash
2017-11-21 12:04:09 -05:00
# If you're running on OS X, you probably need to rebuild
# some dependencies in the docker container, before it will start.
#
2017-11-27 12:09:51 -05:00
#npm rebuild --update-binary
echo ">> Starting server..."
grunt --no-color forever:app:start
2017-11-21 12:04:09 -05:00
echo ">> Waiting for Server"
2017-11-21 12:04:09 -05:00
count=1
max_wait=60
2017-11-21 12:04:09 -05:00
while [ $count -le $max_wait ]
do
if nc -z localhost 3000
then
echo ">> Server Started"
2017-11-21 12:04:09 -05:00
echo ">> Running acceptance tests..."
grunt --no-color mochaTest:acceptance
_test_exit_code=$?
2017-11-21 12:04:09 -05:00
echo ">> Killing server"
2017-11-21 12:04:09 -05:00
grunt --no-color forever:app:stop
2017-11-21 12:04:09 -05:00
echo ">> Done"
exit $_test_exit_code
fi
sleep 1
echo -n "."
count=$((count+1))
done
exit 1