jenkins: run tests using postgres (#39583)

This commit is contained in:
Lauréline Guérin 2020-03-06 09:43:52 +01:00
parent a9cedd9018
commit 769f77c4c8
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
2 changed files with 13 additions and 1 deletions

View File

@ -1,6 +1,15 @@
import os
TIME_ZONE = 'Europe/Paris'
LANGUAGE_CODE = 'en-us'
REST_FRAMEWORK = {
'DEFAULT_AUTHENTICATION_CLASSES': ['rest_framework.authentication.BasicAuthentication'],
}
DATABASES = {
'default': {
'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
'TEST': {'NAME': 'chrono-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],},
}
}

View File

@ -1,5 +1,5 @@
[tox]
envlist = py3-django111-coverage-pylint, py3-django22
envlist = py3-django111-pg-coverage-pylint, py3-django22-pg
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/chrono/{env:BRANCH_NAME:}
[testenv]
@ -9,7 +9,9 @@ usedevelop =
setenv =
DJANGO_SETTINGS_MODULE=chrono.settings
CHRONO_SETTINGS_FILE=tests/settings.py
BRANCH_NAME={env:BRANCH_NAME:}
coverage: COVERAGE=--junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=chrono/
pg: DB_ENGINE=django.db.backends.postgresql_psycopg2
deps =
pytest-cov
pytest-django
@ -27,6 +29,7 @@ deps =
pytest-freezegun
django111: django>=1.11,<1.12
django22: django>=2.2,<2.3
psycopg2-binary
commands =
./getlasso3.sh
py.test {env:COVERAGE:} {posargs:tests/}