-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
65 lines (61 loc) · 1.56 KB
/
docker-compose.yml
File metadata and controls
65 lines (61 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
services:
# Run migration safety tests against PostgreSQL
test-postgres:
image: python:3.12-slim
working_dir: /app
volumes:
- .:/app
environment:
TEST_DATABASE_URL: postgresql://test:test@postgres/mrt_test
command: >
sh -c "pip install -e '.[postgres]' -q &&
pytest tests/ -v --tb=short"
depends_on:
postgres:
condition: service_healthy
# Run migration safety tests against MySQL
test-mysql:
image: python:3.12-slim
working_dir: /app
volumes:
- .:/app
environment:
TEST_DATABASE_URL: mysql+pymysql://test:test@mysql/mrt_test
command: >
sh -c "pip install -e '.[mysql]' -q &&
pytest tests/ -v --tb=short"
depends_on:
mysql:
condition: service_healthy
# Static analysis only (no DB needed)
check:
image: python:3.12-slim
working_dir: /app
volumes:
- .:/app
command: >
sh -c "pip install pytest-mrt -q &&
mrt check alembic/versions/"
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: mrt_test
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test"]
interval: 5s
timeout: 5s
retries: 5
mysql:
image: mysql:8
environment:
MYSQL_USER: test
MYSQL_PASSWORD: test
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: mrt_test
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-utest", "-ptest"]
interval: 5s
timeout: 5s
retries: 10