Make api docker image able to run tests

merge-requests/154/head
Eliot Berriot 2018-03-12 23:07:08 +01:00
rodzic 046648ce6c
commit 99f33dd392
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
4 zmienionych plików z 9 dodań i 22 usunięć

Wyświetl plik

@ -0,0 +1,7 @@
#!/bin/bash
set -e
if [ $1 = "pytest" ]; then
# let pytest.ini handle it
unset DJANGO_SETTINGS_MODULE
fi
exec "$@"

Wyświetl plik

@ -19,10 +19,6 @@ CACHES = {
CELERY_BROKER_URL = 'memory://'
# TESTING
# ------------------------------------------------------------------------------
TEST_RUNNER = 'django.test.runner.DiscoverRunner'
########## CELERY
# In development, all tasks will be executed locally by blocking until the task returns
CELERY_TASK_ALWAYS_EAGER = True
@ -30,3 +26,4 @@ CELERY_TASK_ALWAYS_EAGER = True
# Your local stuff: Below this line define 3rd party library settings
API_AUTHENTICATION_REQUIRED = False
CACHEOPS_ENABLED = False

Wyświetl plik

@ -23,3 +23,4 @@ RUN pip install -r /requirements/test.txt
COPY . /app
WORKDIR /app
ENTRYPOINT ["compose/django/dev-entrypoint.sh"]

Wyświetl plik

@ -1,18 +0,0 @@
version: '2'
services:
test:
build:
dockerfile: docker/Dockerfile.test
context: .
command: pytest
depends_on:
- postgres
volumes:
- .:/app
environment:
- "DJANGO_ALLOWED_HOSTS=localhost"
- "DATABASE_URL=postgresql://postgres@postgres/postgres"
- "FUNKWHALE_URL=https://funkwhale.test"
- "CACHEOPS_ENABLED=False"
postgres:
image: postgres