-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
34 lines (25 loc) · 804 Bytes
/
Dockerfile.test
File metadata and controls
34 lines (25 loc) · 804 Bytes
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
# Dockerfile para Testing
# ======================
# Contenedor aislado para ejecutar tests sin ensuciar el ambiente local
FROM python:3.11-slim
WORKDIR /app
# Instalar dependencias del sistema
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copiar requirements
COPY requirements.txt .
# Instalar dependencias Python
RUN pip install --no-cache-dir -r requirements.txt
# Instalar pytest y coverage
RUN pip install --no-cache-dir pytest pytest-cov pytest-xdist
# Copiar código fuente
COPY src/ ./src/
COPY tests/ ./tests/
COPY data/ ./data/
COPY pytest.ini .
# Configurar PYTHONPATH
ENV PYTHONPATH=/app
# Comando por defecto: ejecutar todos los tests
CMD ["pytest", "tests/", "-v", "--cov=src", "--cov-report=term-missing", "--cov-report=html"]