File tree Expand file tree Collapse file tree 2 files changed +4
-10
lines changed
Expand file tree Collapse file tree 2 files changed +4
-10
lines changed Original file line number Diff line number Diff line change 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
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
Original file line number Diff line number Diff 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
9191class LocalConfig (DefaultConfig ):
You can’t perform that action at this time.
0 commit comments