forked from maziggy/bambuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.test
More file actions
46 lines (34 loc) · 1.21 KB
/
Dockerfile.test
File metadata and controls
46 lines (34 loc) · 1.21 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
# Test image for running backend and frontend tests
FROM python:3.13-slim AS backend-test
WORKDIR /app
# Install system dependencies for testing
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies including test dependencies
COPY requirements.txt ./
COPY requirements-dev.txt ./
RUN pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt
# Copy backend code
COPY backend/ ./backend/
COPY pyproject.toml ./
# Create necessary directories
RUN mkdir -p /app/data /app/logs /app/archive
# Environment variables for testing
ENV PYTHONUNBUFFERED=1
ENV DATA_DIR=/app/data
ENV TESTING=1
# Default command runs pytest (excluding docker integration tests)
# Use -n auto for parallel execution (auto-detects available CPUs)
CMD ["pytest", "backend/tests/", "-v", "--tb=short", "-p", "no:cacheprovider", "-n", "auto"]
# -------------------------------------------
# Frontend test stage
FROM node:22-bookworm-slim AS frontend-test
WORKDIR /app/frontend
# Copy package files and install
COPY frontend/package*.json ./
RUN npm ci
# Copy frontend source
COPY frontend/ ./
# Default command runs tests
CMD ["npm", "test", "--", "--run"]