From 3cff6619cb23d09db178bee384e5ec6bb815b92f Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Thu, 3 Sep 2020 22:16:27 +0200 Subject: [PATCH] Run precommit and check for missing migrations during tests --- .dockerignore | 1 - docker/runtests.sh | 2 ++ tests.Dockerfile | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 20a9e0a..1f733ae 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,5 +2,4 @@ db/ media/ staticfiles/ .pytest_cache/ -.git/ .idea/ diff --git a/docker/runtests.sh b/docker/runtests.sh index a22b9ed..4615c67 100755 --- a/docker/runtests.sh +++ b/docker/runtests.sh @@ -1,2 +1,4 @@ #!/bin/sh TESTING=true python -m pytest +pre-commit run --all-files +TESTING=true python manage.py makemigrations --check diff --git a/tests.Dockerfile b/tests.Dockerfile index f4a909f..fc27ab3 100644 --- a/tests.Dockerfile +++ b/tests.Dockerfile @@ -3,4 +3,8 @@ RUN pip install -r requirements-dev.txt ENV TESTING "true" WORKDIR /app HEALTHCHECK none -CMD ["python", "-m", "pytest"] +# Required for pre-commit +RUN apt-get install -y git +COPY .git ./.git/ + +CMD ["/app/docker/runtests.sh"]