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

14
backend/Dockerfile.test Normal file
View File

@@ -0,0 +1,14 @@
FROM python:3.9
WORKDIR /app
# Устанавливаем зависимости
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install pytest pytest-asyncio pytest-cov
# Копируем код приложения
COPY . .
# Ждем доступности базы данных и запускаем тесты
CMD ["sh", "-c", "while ! nc -z test-db 5432; do sleep 1; done; pytest tests/ -v --cov=app"]