Skip to content

Commit

Permalink
create default test db
Browse files Browse the repository at this point in the history
  • Loading branch information
delcroip committed Aug 23, 2023
1 parent c0c48ea commit db5bcf6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ jobs:
- name: Initialize DB
run: |
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q 'DROP DATABASE IF EXISTS imis'
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q 'CREATE DATABASE imis'
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -d imis -i sql/output/fullEmptyDatabase.sql | grep . | uniq -c
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q 'DROP DATABASE IF EXISTS imis_test'
/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P $SA_PASSWORD -Q 'CREATE DATABASE imis_test'
/opt/mssql-tools/bin/sqlcmd -S localhost,1433 -U SA -P $SA_PASSWORD -d imis_test -i sql/output/fullEmptyDatabase.sql | grep . | uniq -c
env:
SA_PASSWORD: GitHub999

Expand All @@ -76,7 +76,7 @@ jobs:
#DJANGO_SETTINGS_MODULE: hat.settings
DB_HOST: localhost
DB_PORT: 1433
DB_NAME: imis
DB_NAME: imis_test
DB_USER: sa
DB_PASSWORD: GitHub999
#DEV_SERVER: true
Expand All @@ -98,7 +98,7 @@ jobs:
#DJANGO_SETTINGS_MODULE: hat.settings
DB_HOST: localhost
DB_PORT: 1433
DB_NAME: imis
DB_NAME: imis_test
DB_USER: sa
DB_PASSWORD: GitHub999
#DEV_SERVER: true
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
env:
DB_HOST: localhost
DB_PORT: 5432
POSTGRES_DB: imis
POSTGRES_DB: imis_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: GitHub999
ports:
Expand Down Expand Up @@ -64,12 +64,12 @@ jobs:
- name: Initialize DB
run: |
echo 'set search_path to public' >> ~/.psqlrc
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/00_dump.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/02_aux_functions.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/03_views.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/04_functions.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/05_stored_procs.sql | grep . | uniq -c
# PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis -U postgres -f ./sql/database\ scripts/demo_db.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis_test -U postgres -f ./sql/database\ scripts/00_dump.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis_test -U postgres -f ./sql/database\ scripts/02_aux_functions.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis_test -U postgres -f ./sql/database\ scripts/03_views.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis_test -U postgres -f ./sql/database\ scripts/04_functions.sql | grep . | uniq -c
PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis_test -U postgres -f ./sql/database\ scripts/05_stored_procs.sql | grep . | uniq -c
# PGPASSWORD=GitHub999 psql -U postgres -h localhost -d imis_test -U postgres -f ./sql/database\ scripts/demo_db.sql | grep . | uniq -c

- name: Django tests
run: |
Expand All @@ -87,7 +87,7 @@ jobs:
#DJANGO_SETTINGS_MODULE: hat.settings
DB_HOST: localhost
DB_PORT: 5432
DB_NAME: imis
DB_NAME: imis_test
DB_USER: postgres
DB_PASSWORD: GitHub999
#DEV_SERVER: true
Expand Down
2 changes: 1 addition & 1 deletion openIMIS/openIMIS/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def SITE_URL():
"PORT": os.environ.get("DB_PORT"),
"OPTIONS": DATABASE_OPTIONS,
'TEST': {
'NAME': os.environ.get("DB_NAME"),
'NAME': 'imis_test',
},
}
}
Expand Down

0 comments on commit db5bcf6

Please sign in to comment.