Skip to content

Commit

Permalink
fix host name
Browse files Browse the repository at this point in the history
  • Loading branch information
djeck1432 committed Nov 29, 2024
1 parent a2b1fc1 commit b536f8e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/dashboard_app_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ jobs:
sed -i 's/DB_PASSWORD=.*/DB_PASSWORD=postgres/' .env
sed -i 's/DB_NAME=.*/DB_NAME=dashboard_app/' .env
- name: Set DATABASE_URL for Tests
run: echo "DATABASE_URL=postgresql://postgres:[email protected]:5432/dashboard_app" >> $GITHUB_ENV

- name: Wait for Database to be Ready
run: |
for i in {1..30}; do
Expand All @@ -61,6 +64,13 @@ jobs:
run: |
nc -zv 127.0.0.1 5432
- name: Create Test Database If Not Exists
run: |
PGPASSWORD=postgres psql -h 127.0.0.1 -p 5432 -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'dashboard_app'" | grep -q 1 || \
PGPASSWORD=postgres psql -h 127.0.0.1 -p 5432 -U postgres -c "CREATE DATABASE dashboard_app;"
- name: Run Tests for Dashboard_App
working-directory: ./apps/dashboard_app
env:
DATABASE_URL: postgresql://postgres:[email protected]:5432/dashboard_app
run: poetry run pytest
2 changes: 1 addition & 1 deletion apps/dashboard_app/.env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=dashboard_app
DB_HOST=localhost
DB_HOST=127.0.0.1
DB_PORT=5432

0 comments on commit b536f8e

Please sign in to comment.