-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |