Skip to content
Snippets Groups Projects
Verified Commit 99f33dd3 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Make api docker image able to run tests

parent 046648ce
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
set -e
if [ $1 = "pytest" ]; then
# let pytest.ini handle it
unset DJANGO_SETTINGS_MODULE
fi
exec "$@"
......@@ -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
......@@ -23,3 +23,4 @@ RUN pip install -r /requirements/test.txt
COPY . /app
WORKDIR /app
ENTRYPOINT ["compose/django/dev-entrypoint.sh"]
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment