forked from maziggy/bambuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
64 lines (60 loc) · 1.59 KB
/
docker-compose.test.yml
File metadata and controls
64 lines (60 loc) · 1.59 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
services:
# Backend unit tests
backend-test:
build:
context: .
dockerfile: Dockerfile.test
target: backend-test
container_name: bambuddy-backend-test
volumes:
- ./backend:/app/backend:ro
environment:
- TESTING=1
- PYTHONUNBUFFERED=1
# Frontend unit tests
frontend-test:
build:
context: .
dockerfile: Dockerfile.test
target: frontend-test
container_name: bambuddy-frontend-test
volumes:
- ./frontend/src:/app/frontend/src:ro
- ./frontend/tests:/app/frontend/tests:ro
# Integration test - full application
integration:
build:
context: .
dockerfile: Dockerfile
container_name: bambuddy-integration-test
ports:
- "8001:8000"
environment:
- TESTING=1
- DATA_DIR=/app/data
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
volumes:
- integration_test_data:/app/data
# Integration test runner
integration-test-runner:
build:
context: .
dockerfile: Dockerfile.test
target: backend-test
container_name: bambuddy-integration-runner
depends_on:
integration:
condition: service_healthy
environment:
- BAMBUDDY_TEST_URL=http://integration:8000
- TESTING=1
command: ["pytest", "backend/tests/integration/", "-v", "--tb=short", "-p", "no:cacheprovider", "-n", "auto"]
volumes:
- ./backend:/app/backend:ro
volumes:
integration_test_data: