Skip to content

Commit

Permalink
Update Dockerfile.test
Browse files Browse the repository at this point in the history
  • Loading branch information
Garima Ketan Chauhan authored and GitHub Enterprise committed Apr 2, 2025
1 parent 7f700f9 commit 03d5807
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions backend/tests/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Use a base Python image
FROM python:3.9-slim

# Set the working directory in the container
WORKDIR /app

# Copy the application code into the container
COPY . /app
# Install dependencies from backend/requirements.txt
COPY ../backend/requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Install dependencies (including coverage)
RUN pip install --no-cache-dir -r requirements.txt && pip install --no-cache-dir coverage
# Install coverage (if not in requirements.txt)
RUN pip install --no-cache-dir coverage

# Run Django tests with coverage
CMD ["sh", "-c", "coverage run manage.py test"]
# Copy application code and tests into the container
COPY ../backend /app/backend
COPY . /app/tests

# Run tests with coverage
CMD ["bash", "-c", "pytest --cov=backend --cov-report=xml"]

0 comments on commit 03d5807

Please sign in to comment.