From 18889a721d4076ee7e555225fb09ea684d865539 Mon Sep 17 00:00:00 2001 From: Gargi Ketan Chauhan Date: Wed, 2 Apr 2025 10:51:57 +0200 Subject: [PATCH] Update Dockerfile.test so as to run the coverage module from docker --- backend/tests/Dockerfile.test | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/tests/Dockerfile.test b/backend/tests/Dockerfile.test index 7c28661..15b9b70 100644 --- a/backend/tests/Dockerfile.test +++ b/backend/tests/Dockerfile.test @@ -1,16 +1,13 @@ -# We Use an official Python runtime as a parent image +# dockerfile.test FROM python:3.12-slim -# Allows docker to cache installed dependencies between builds COPY requirements.txt requirements.txt RUN pip install --no-cache-dir -r requirements.txt -# Mounts the application code to the image +RUN pip install coverage + RUN mkdir /app COPY . /app WORKDIR /app -EXPOSE 8000 - -# Runs migrations and starts the server -CMD ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"] +CMD ["sh", "-c", "coverage run --source='.' manage.py test && coverage report"]