Merge pull request 'Fix problems in unit tests where DB access was attempted before DB was ready' (#13) from fix/postgres-health-timeout into main
All checks were successful
Run unit tests / unit_tests (push) Successful in 3m48s

Reviewed-on: #13
This commit is contained in:
bustikiller 2024-07-30 22:48:29 +00:00
commit 46d0c8f947

View File

@ -13,11 +13,6 @@ jobs:
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432
steps:
@ -26,8 +21,16 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: ruby/setup-ruby@v1
- run: bundle install
- name: Wait until Postgres is ready to accept connections
run: |
apt-get update && apt-get install -f -y postgresql-client
until pg_isready -h postgres -U postgres -d postgres
do
sleep 1
echo "Trying again"
done
- run: |
bundle exec rake db:create db:schema:load
bundle exec rake db:schema:load
bundle exec rspec
env:
RAILS_ENV: test