Skip to content

Commit 09ec777

Browse files
committed
Improve database configuration for testing
1 parent 768dd77 commit 09ec777

File tree

3 files changed

+21
-13
lines changed

3 files changed

+21
-13
lines changed

.github/workflows/python-test.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@ jobs:
1313
python-version: ["3.11", "3.12"]
1414

1515
services:
16-
postgres:
16+
default-database:
1717
image: postgres:15.5-alpine
1818
env:
19-
POSTGRES_PASSWORD: password
20-
POSTGRES_DB: flagsmith
19+
POSTGRES_HOST_AUTH_METHOD: trust
2120
ports: ['5432:5432']
2221
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2322

23+
task-processor-database:
24+
image: postgres:15.5-alpine
25+
env:
26+
POSTGRES_HOST_AUTH_METHOD: trust
27+
ports: ['5433:5432']
28+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
29+
2430
steps:
2531
- uses: actions/checkout@v4
2632

docker/docker-compose.local.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
1-
# A Compose file with minimal dependencies to be able to run Flagsmith, including its test suite, locally (not in Docker).
1+
# Minimal dependencies to run Flagsmith non-Dockerized, including its test
2+
# suite. Currently, settings are analogous to CI for compatibility.
3+
4+
# TODO: Use Docker Compose in CI to run tests.
25

36
name: flagsmith
47

58
volumes:
6-
pg_data:
7-
task_processor_pg_data:
9+
default-database:
10+
task-processor-database:
811

912
services:
10-
db:
13+
default-database:
1114
image: postgres:15.5-alpine
1215
restart: unless-stopped
1316
volumes:
14-
- pg_data:/var/lib/postgresql/data
17+
- default-database:/var/lib/postgresql/data
1518
ports:
1619
- 5432:5432
1720
environment:
18-
POSTGRES_DB: flagsmith
19-
POSTGRES_PASSWORD: password
21+
POSTGRES_HOST_AUTH_METHOD: trust
2022
healthcheck:
2123
test: pg_isready -Upostgres
2224
interval: 1s
2325
timeout: 30s
2426

25-
task-processor-db:
27+
task-processor-database:
2628
image: postgres:15.5-alpine
2729
restart: unless-stopped
2830
volumes:
29-
- task_processor_pg_data:/var/lib/postgresql/data
31+
- task-processor-database:/var/lib/postgresql/data
3032
ports:
3133
- 5433:5432
3234
environment:

settings/dev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"default": dj_database_url.parse(
2929
env(
3030
"DATABASE_URL",
31-
default="postgresql://postgres:password@localhost:5432/flagsmith",
31+
default="postgresql://postgres@localhost:5432/postgres",
3232
),
3333
),
3434
"task_processor": dj_database_url.parse(

0 commit comments

Comments
 (0)