-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (65 loc) · 1.63 KB
/
docker-compose.yml
File metadata and controls
69 lines (65 loc) · 1.63 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
version: '3.8'
services:
# Sample REST API server
testapi:
build:
context: ./testapi
dockerfile: Dockerfile
container_name: testapi
ports:
- "8080:8080"
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8080/health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
networks:
- test-network
# Toxiproxy for network simulation
toxiproxy:
image: ghcr.io/shopify/toxiproxy:2.5.0
container_name: toxiproxy
ports:
- "8474:8474" # API port
- "8081:8081" # Proxy port for testapi
depends_on:
testapi:
condition: service_healthy
volumes:
- ./toxiproxy-config.json:/config.json
command: -config=/config.json
networks:
- test-network
# HTTP Runner for testing
httprunner:
profiles:
- runner
build:
context: .
dockerfile: Dockerfile
container_name: httprunner
depends_on:
testapi:
condition: service_healthy
toxiproxy:
condition: service_started
volumes:
- ./tests:/requests
- ./results:/reports
environment:
- BASEURL=http://testapi:8080
- TOXIPROXY_URL=http://toxiproxy:8081
- API_VERSION=v1
working_dir: /httprunner
command: >
sh -c "
echo 'Starting comprehensive test suite...' &&
./httprunner -u 5 -i 10 -d 50 -f /requests/e2e/comprehensive-test.http -output /reports -detail summary -report html &&
echo 'Test completed. Results saved in reports/'
"
networks:
- test-network
networks:
test-network:
driver: bridge