Skip to content

Commit

Permalink
Merge pull request HabitRPG#2869 from denis-sokolov/travis
Browse files Browse the repository at this point in the history
chore(travis): remove travis config until the issues are resolved
  • Loading branch information
lefnire committed Feb 22, 2014
2 parents aaa38a5 + 7d17752 commit b950566
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions test/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,32 @@ grunt build:dev
# Launch Node server and Selenium
echo "Recreating test database"
mongo "$TEST_DB" --eval "db.dropDatabase()"
./node_modules/protractor/bin/webdriver-manager update
./node_modules/protractor/bin/webdriver-manager start > /dev/null &

if [ -z "$TRAVIS" ]; then
./node_modules/protractor/bin/webdriver-manager update
./node_modules/protractor/bin/webdriver-manager start > /dev/null &
trap "curl http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer" EXIT

# Wait for selenium
MAX_WAIT=30
WAITED=0
until nc -z localhost 4444; do
if [ $WAITED -ge $MAX_WAIT ]; then
echo "Waited $MAX_WAIT seconds, but Selenium never responded" >&2
kill $NODE_PID
exit 1
fi
sleep 1
let 'WAITED+=1'
done
fi

NODE_DB_URI="$TEST_DB_URI" PORT=$TEST_SERVER_PORT node ./src/server.js > /dev/null &
NODE_PID=$!
trap "kill $NODE_PID && curl http://localhost:4444/selenium-server/driver/?cmd=shutDownSeleniumServer" EXIT
trap "kill $NODE_PID" EXIT

# Wait for selenium
MAX_WAIT=30
WAITED=0
until nc -z localhost 4444; do
if [ $WAITED -ge $MAX_WAIT ]; then
echo "Waited $MAX_WAIT seconds, but Selenium never responded" >&2
kill $NODE_PID
exit 1
fi
sleep 1
let 'WAITED+=1'
done
NODE_ENV=testing mocha

mocha && grunt karma:continuous && ./node_modules/protractor/bin/protractor protractor.conf.js
if [ $? -eq 0 ] && [ -z "$TRAVIS" ]; then
NODE_ENV=testing grunt karma:continuous && ./node_modules/protractor/bin/protractor protractor.conf.js
fi

0 comments on commit b950566

Please sign in to comment.