Now use postgres in tests

merge-requests/154/head
Eliot Berriot 2017-12-28 22:59:43 +01:00
rodzic 8ad33786ed
commit c7636c9528
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DD6965E2476E5C27
3 zmienionych plików z 19 dodań i 15 usunięć

Wyświetl plik

@ -11,11 +11,14 @@ stages:
- deploy
test_api:
services:
- postgres:9.4
stage: test
image: funkwhale/funkwhale:base
variables:
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
DATABASE_URL: "sqlite://"
DATABASE_URL: "postgresql://postgres@postgres/postgres"
before_script:
- python3 -m venv --copies virtualenv
- source virtualenv/bin/activate

Wyświetl plik

@ -1,11 +1,5 @@
from .common import * # noqa
SECRET_KEY = env("DJANGO_SECRET_KEY", default='test')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
}
}
# Mail settings
# ------------------------------------------------------------------------------

Wyświetl plik

@ -1,8 +1,15 @@
test:
dockerfile: docker/Dockerfile.test
build: .
command: pytest
volumes:
- .:/app
environment:
- "DATABASE_URL=sqlite://"
version: '2'
services:
test:
build:
dockerfile: docker/Dockerfile.test
context: .
command: pytest
depends_on:
- postgres
volumes:
- .:/app
environment:
- "DATABASE_URL=postgresql://postgres@postgres/postgres"
postgres:
image: postgres