Now use postgres in tests
This commit is contained in:
parent
8ad33786ed
commit
c7636c9528
|
@ -11,11 +11,14 @@ stages:
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
test_api:
|
test_api:
|
||||||
|
services:
|
||||||
|
- postgres:9.4
|
||||||
stage: test
|
stage: test
|
||||||
image: funkwhale/funkwhale:base
|
image: funkwhale/funkwhale:base
|
||||||
variables:
|
variables:
|
||||||
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
|
PIP_CACHE_DIR: "$CI_PROJECT_DIR/pip-cache"
|
||||||
DATABASE_URL: "sqlite://"
|
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- python3 -m venv --copies virtualenv
|
- python3 -m venv --copies virtualenv
|
||||||
- source virtualenv/bin/activate
|
- source virtualenv/bin/activate
|
||||||
|
|
|
@ -1,11 +1,5 @@
|
||||||
from .common import * # noqa
|
from .common import * # noqa
|
||||||
SECRET_KEY = env("DJANGO_SECRET_KEY", default='test')
|
SECRET_KEY = env("DJANGO_SECRET_KEY", default='test')
|
||||||
DATABASES = {
|
|
||||||
'default': {
|
|
||||||
'ENGINE': 'django.db.backends.sqlite3',
|
|
||||||
'NAME': ':memory:',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Mail settings
|
# Mail settings
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
23
api/test.yml
23
api/test.yml
|
@ -1,8 +1,15 @@
|
||||||
test:
|
version: '2'
|
||||||
dockerfile: docker/Dockerfile.test
|
services:
|
||||||
build: .
|
test:
|
||||||
command: pytest
|
build:
|
||||||
volumes:
|
dockerfile: docker/Dockerfile.test
|
||||||
- .:/app
|
context: .
|
||||||
environment:
|
command: pytest
|
||||||
- "DATABASE_URL=sqlite://"
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
environment:
|
||||||
|
- "DATABASE_URL=postgresql://postgres@postgres/postgres"
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
|
Loading…
Reference in New Issue