-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
72 lines (68 loc) · 1.66 KB
/
docker-compose.test.yml
File metadata and controls
72 lines (68 loc) · 1.66 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
version: '3.8'
services:
# Keycloak for real OIDC testing
keycloak:
image: quay.io/keycloak/keycloak:23.0
environment:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_HTTP_ENABLED: "true"
KC_HOSTNAME_STRICT: "false"
KC_HOSTNAME_STRICT_HTTPS: "false"
ports:
- "8180:8080"
command:
- start-dev
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health/ready"]
interval: 10s
timeout: 5s
retries: 30
networks:
- test-network
# Mock Kubernetes API server
mock-k8s-api:
image: python:3.11-slim
working_dir: /app
volumes:
- ./tests/mock_k8s_api:/app
command: python mock_k8s_api.py
ports:
- "6443:6443"
networks:
- test-network
depends_on:
keycloak:
condition: service_healthy
# Test runner
test-runner:
build:
context: .
dockerfile: Dockerfile.test
volumes:
- .:/app
- /var/run/docker.sock:/var/run/docker.sock
environment:
# Point to Keycloak running in Docker
OIDC_ISSUER: http://keycloak:8080/realms/test
OIDC_CLIENT_ID: test-client
OIDC_CLIENT_SECRET: test-secret
K8S_API_HOST: https://mock-k8s-api:6443
# Skip SSL verification for test environment
PYTHONDONTWRITEBYTECODE: 1
PYTHONUNBUFFERED: 1
networks:
- test-network
depends_on:
keycloak:
condition: service_healthy
mock-k8s-api:
condition: service_started
command: >
bash -c "
pip install -e . &&
pytest tests/integration/ -v -m integration --tb=short
"
networks:
test-network:
driver: bridge