Skip to content

Commit 4b03fae

Browse files
UPDATE Test ci
1 parent c19fc7d commit 4b03fae

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

.github/workflows/development_pipeline.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
POSTGRES_DB: db_test
1919
ports:
2020
- 5432:5432
21-
21+
# needed because the postgres container does not provide a healthcheck
22+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2223
steps:
2324
- name: Checkout code
2425
uses: actions/checkout@v2
@@ -41,13 +42,6 @@ jobs:
4142

4243
- name: Unit Tests
4344
env:
44-
DATABASE_TEST_URL: "postgresql://db_user:db_password@postgres:5432/db_test"
45-
APP_NAME: "Flask API Rest Template"
46-
APP_ENV: "develop"
47-
FLASK_APP: "app:app"
48-
FLASK_DEBUG: "true"
49-
APP_TEST_SETTINGS_MODULE: "config.TestingConfig"
50-
FLASK_RUN_HOST: "0.0.0.0"
51-
FLASK_RUN_PORT: "5000"
45+
DATABASE_TEST_URL: postgresql://db_user:db_password@postgres:5432/db_test
5246
run: python -m flask tests
5347

config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class TestingConfig(DefaultConfig):
8585
LOG_FILE_API = f'{basedir}/logs/api_tests.log'
8686

8787
# Database configuration
88-
SQLALCHEMY_DATABASE_URI = "postgresql://db_user:db_password@postgres:5432/db_test"
88+
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_TEST_URL')
8989

9090

9191
class LocalConfig(DefaultConfig):

0 commit comments

Comments
 (0)