-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
72 lines (68 loc) · 2.07 KB
/
Copy pathdocker-compose.test.yml
File metadata and controls
72 lines (68 loc) · 2.07 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
# RenderTrust E2E Test Infrastructure
# Ephemeral Docker Compose stack for running the full test suite against
# real PostgreSQL 16 and Redis 7 instances.
#
# Usage:
# ./scripts/run-e2e.sh # recommended wrapper
# make test-e2e # Makefile target
#
# This file is intentionally independent of docker-compose.yml: different
# container names, ports, networks, and volumes so the two can coexist.
services:
test-db:
image: postgres:16-alpine
environment:
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_pass
POSTGRES_DB: rendertrust_test
healthcheck:
test: ["CMD-SHELL", "pg_isready -U test_user"]
interval: 3s
timeout: 3s
retries: 10
# tmpfs for ephemeral storage -- no data survives container removal
tmpfs:
- /var/lib/postgresql/data
networks:
- test-network
test-redis:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 3s
timeout: 3s
retries: 10
networks:
- test-network
test-runner:
image: python:3.11-slim
working_dir: /app
volumes:
- .:/app
environment:
APP_ENV: testing
APP_DEBUG: "false"
SECRET_KEY: test-secret-key-not-for-production
JWT_SECRET_KEY: test-jwt-secret-not-for-production
DATABASE_URL: "postgresql+asyncpg://test_user:test_pass@test-db:5432/rendertrust_test"
TEST_DATABASE_URL: "postgresql+asyncpg://test_user:test_pass@test-db:5432/rendertrust_test"
REDIS_URL: "redis://test-redis:6379/1"
STRIPE_SECRET_KEY: sk_test_fake
STRIPE_WEBHOOK_SECRET: whsec_test_fake
depends_on:
test-db:
condition: service_healthy
test-redis:
condition: service_healthy
command: >
bash -c "
apt-get update -qq && apt-get install -y -qq libpq-dev gcc > /dev/null 2>&1 &&
pip install -q -e '.[dev]' &&
alembic upgrade head &&
python -m pytest tests/integration/ tests/e2e/ -v --tb=short
"
networks:
- test-network
networks:
test-network:
driver: bridge