Repository navigation
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
87 lines (84 loc) · 2.37 KB
/
Copy pathdocker-compose.test.yml
File metadata and controls
87 lines (84 loc) · 2.37 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Local databases for connector integration tests.
#
# Start: docker compose -f docker-compose.test.yml up -d
# Stop: docker compose -f docker-compose.test.yml down
# Logs: docker compose -f docker-compose.test.yml logs -f postgres
#
# Then run Postgres integration tests:
# export TEST_POSTGRES_URL=postgresql://chitral:chitral@localhost:5433/chitral_test
# cd backend && uv run pytest tests/connectors/test_postgres_client.py -v -m integration
#
# Or use: make test-db-up && make test-postgres
#
# MySQL integration tests:
# export TEST_MYSQL_URL=mysql://chitral:chitral@localhost:3307/chitral_test
# cd backend && uv run pytest tests/connectors/test_mysql_client.py -v -m integration
#
# Or use: make test-mysql
#
# MongoDB integration tests:
# export TEST_MONGODB_URL=mongodb://chitral:chitral@localhost:27018/?authSource=admin
# cd backend && uv run pytest tests/connectors/test_mongodb_client.py -v -m integration
#
# Or use: make test-mongodb
services:
postgres:
image: postgres:16-alpine
container_name: chitral-test-postgres
ports:
- "5433:5432"
environment:
POSTGRES_USER: chitral
POSTGRES_PASSWORD: chitral
POSTGRES_DB: chitral_test
healthcheck:
test: ["CMD-SHELL", "pg_isready -U chitral -d chitral_test"]
interval: 2s
timeout: 5s
retries: 15
start_period: 5s
tmpfs:
- /var/lib/postgresql/data
mysql:
image: mysql:8.0
container_name: chitral-test-mysql
ports:
- "3307:3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USER: chitral
MYSQL_PASSWORD: chitral
MYSQL_DATABASE: chitral_test
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot"]
interval: 2s
timeout: 5s
retries: 20
start_period: 15s
tmpfs:
- /var/lib/mysql
mongodb:
image: mongo:7
container_name: chitral-test-mongodb
ports:
- "27018:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: chitral
MONGO_INITDB_ROOT_PASSWORD: chitral
healthcheck:
test:
[
"CMD",
"mongosh",
"--quiet",
"-u", "chitral",
"-p", "chitral",
"--authenticationDatabase", "admin",
"--eval", "db.adminCommand('ping')",
]
interval: 2s
timeout: 5s
retries: 20
start_period: 10s
tmpfs:
- /data/db