Projet

Général

Profil

0001-jenkins-run-tests-using-postgres-39583.patch

Lauréline Guérin, 06 mars 2020 10:51

Télécharger (1,76 ko)

Voir les différences:

Subject: [PATCH 1/2] jenkins: run tests using postgres (#39583)

 tests/settings.py | 9 +++++++++
 tox.ini           | 5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)
tests/settings.py
1
import os
2

  
1 3
TIME_ZONE = 'Europe/Paris'
2 4
LANGUAGE_CODE = 'en-us'
3 5

  
4 6
REST_FRAMEWORK = {
5 7
    'DEFAULT_AUTHENTICATION_CLASSES': ['rest_framework.authentication.BasicAuthentication'],
6 8
}
9

  
10
DATABASES = {
11
    'default': {
12
        'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
13
        'TEST': {'NAME': 'chrono-test-%s' % os.environ.get("BRANCH_NAME", "").replace('/', '-')[:63],},
14
    }
15
}
tox.ini
1 1
[tox]
2
envlist = py3-django111-coverage-pylint, py3-django22
2
envlist = py3-django111-pg-coverage-pylint, py3-django22-pg
3 3
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/chrono/{env:BRANCH_NAME:}
4 4

  
5 5
[testenv]
......
9 9
setenv =
10 10
  DJANGO_SETTINGS_MODULE=chrono.settings
11 11
  CHRONO_SETTINGS_FILE=tests/settings.py
12
  BRANCH_NAME={env:BRANCH_NAME:}
12 13
  coverage: COVERAGE=--junitxml=junit-{envname}.xml --cov-report xml --cov-report html --cov=chrono/
14
  pg: DB_ENGINE=django.db.backends.postgresql_psycopg2
13 15
deps =
14 16
  pytest-cov
15 17
  pytest-django
......
27 29
  pytest-freezegun
28 30
  django111: django>=1.11,<1.12
29 31
  django22: django>=2.2,<2.3
32
  psycopg2-binary
30 33
commands =
31 34
  ./getlasso3.sh
32 35
  py.test {env:COVERAGE:} {posargs:tests/}
33
-