mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-08-11 00:30:12 -04:00
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
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", "30"]
|
|
volumes:
|
|
- ./backend:/app/backend:ro
|
|
|
|
volumes:
|
|
integration_test_data:
|