1
0
mirror of https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git synced 2025-08-14 00:25:46 +02:00

Тесты для бекенда

This commit is contained in:
MoonTestUse1
2025-01-04 02:19:41 +06:00
parent 2f13b75f3d
commit 0d543ed4f6
8 changed files with 611 additions and 0 deletions

42
docker-compose.test.yml Normal file
View File

@@ -0,0 +1,42 @@
version: '3.8'
services:
test-db:
image: postgres:13
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: support_test
ports:
- "5433:5432" # Используем другой порт, чтобы не конфликтовать с основной БД
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
test-redis:
image: redis:alpine
ports:
- "6380:6379" # Используем другой порт, чтобы не конфликтовать с основным Redis
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
backend-tests:
build:
context: ./backend
dockerfile: Dockerfile.test
environment:
DATABASE_URL: postgresql://postgres:postgres@test-db:5432/support_test
REDIS_URL: redis://test-redis:6379/0
depends_on:
test-db:
condition: service_healthy
test-redis:
condition: service_healthy
volumes:
- ./backend:/app
- ./test-results:/app/test-results