Poll for the database to be up before running tests

This commit is contained in:
Matt Rogers 2018-05-30 08:21:21 -05:00
parent 9f65d809da
commit 49bc3eb0cd
No known key found for this signature in database
GPG key ID: 605D017C07EB4316
2 changed files with 19 additions and 1 deletions

View file

@ -7,6 +7,12 @@ function cleanup() {
$docker_compose down
}
function die() {
echo $@
exit 1
}
trap cleanup EXIT
export RAILS_ENV=test
@ -16,7 +22,7 @@ cp config/site.yml.tmpl config/site.yml
$docker_compose build
$docker_compose up -d
sleep 5 # janky way of waiting for the database to be up
script/poll-for-db
# Leaving this in since it will be needed for Rails 5
# bin/rails db:environment:set RAILS_ENV=test || true