tox.ini: refactor, add dj22 target
This commit is contained in:
parent
bac72330f1
commit
a5e4d42e02
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
set -e -x
|
|
||||||
env
|
|
||||||
if [ -f /var/lib/jenkins/pylint.django.rc ]; then
|
if [ -f /var/lib/jenkins/pylint.django.rc ]; then
|
||||||
PYLINT_RC=/var/lib/jenkins/pylint.django.rc
|
PYLINT_RC=/var/lib/jenkins/pylint.django.rc
|
||||||
elif [ -f pylint.django.rc ]; then
|
elif [ -f pylint.django.rc ]; then
|
||||||
|
@ -10,4 +10,4 @@ else
|
||||||
echo No pylint RC found
|
echo No pylint RC found
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
|
pylint -f parseable --rcfile ${PYLINT_RC} "$@" > pylint.out || /bin/true
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
LANGUAGE_CODE = 'en'
|
ALLOWED_HOSTS = ['localhost']
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
'default': {
|
'default': {
|
||||||
'ENGINE': os.environ.get('DB_ENGINE', 'django.db.backends.sqlite3'),
|
'ENGINE': 'django.db.backends.postgresql_psycopg2',
|
||||||
'TEST': {
|
'NAME': 'authentic2-cut',
|
||||||
'NAME': 'a2-test',
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if 'postgres' in DATABASES['default']['ENGINE']:
|
||||||
|
for key in ('PGPORT', 'PGHOST', 'PGUSER', 'PGPASSWORD'):
|
||||||
|
if key in os.environ:
|
||||||
|
DATABASES['default'][key[2:]] = os.environ[key]
|
||||||
|
|
||||||
|
LANGUAGE_CODE = 'en'
|
||||||
A2_FC_CLIENT_ID = ''
|
A2_FC_CLIENT_ID = ''
|
||||||
A2_FC_CLIENT_SECRET = ''
|
A2_FC_CLIENT_SECRET = ''
|
||||||
|
|
100
tox.ini
100
tox.ini
|
@ -5,45 +5,79 @@
|
||||||
|
|
||||||
[tox]
|
[tox]
|
||||||
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/authentic2-cut/{env:BRANCH_NAME:}
|
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/authentic2-cut/{env:BRANCH_NAME:}
|
||||||
envlist = py{27,3}-coverage-dj111-pg
|
envlist =
|
||||||
|
py2-dj111-drf34
|
||||||
|
py3-dj111-drf34
|
||||||
|
py3-dj22-drf39
|
||||||
|
|
||||||
|
[tox:jenkins]
|
||||||
|
envlist =
|
||||||
|
pylint
|
||||||
|
py2-dj111-drf34
|
||||||
|
py3-dj111-drf34
|
||||||
|
py3-dj22-drf39
|
||||||
|
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
# django.contrib.auth is not tested it does not work with our templates
|
|
||||||
setenv =
|
setenv =
|
||||||
AUTHENTIC2_SETTINGS_FILE=tests/settings.py
|
AUTHENTIC2_SETTINGS_FILE=tests/settings.py
|
||||||
DJANGO_SETTINGS_MODULE=authentic2.settings
|
DJANGO_SETTINGS_MODULE=authentic2.settings
|
||||||
sqlite: DB_ENGINE=django.db.backends.sqlite3
|
|
||||||
pg: DB_ENGINE=django.db.backends.postgresql_psycopg2
|
JUNIT={tty::-o junit_suite_name={envname} --junit-xml=junit-{envname}.xml}
|
||||||
coverage: COVERAGE=--junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=src/ --cov-config .coveragerc
|
COVERAGE={tty::--junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=src/ --cov-config .coveragerc}
|
||||||
fast: FAST=--nomigrations
|
passenv=
|
||||||
usedevelop =
|
BRANCH_NAME
|
||||||
coverage: True
|
# support for pg_virtualenv
|
||||||
nocoverage: False
|
PGPORT
|
||||||
|
PGHOST
|
||||||
|
PGUSER
|
||||||
|
PGPASSWORD
|
||||||
|
usedevelop = true
|
||||||
deps =
|
deps =
|
||||||
dj111: django>=1.11,<1.12
|
|
||||||
dj111: django-tables2>=1.1,<2
|
|
||||||
pg: psycopg2
|
|
||||||
coverage
|
|
||||||
pytest-cov
|
|
||||||
pytest-django<3.4.6
|
|
||||||
mock
|
|
||||||
pytest
|
|
||||||
lxml
|
|
||||||
cssselect
|
|
||||||
pylint
|
|
||||||
pylint-django<0.8.1
|
|
||||||
django-webtest<1.9.3
|
|
||||||
WebTest
|
|
||||||
pyquery
|
|
||||||
httmock
|
|
||||||
pytz
|
|
||||||
requests
|
|
||||||
pytest-freezegun
|
|
||||||
enum34<=1.1.6
|
|
||||||
py27: django-appconf<1.0.4
|
|
||||||
http://git.entrouvert.org/authentic.git/snapshot/authentic-master.tar.gz
|
http://git.entrouvert.org/authentic.git/snapshot/authentic-master.tar.gz
|
||||||
|
# dependency constraints for authentic
|
||||||
|
py2: django-appconf<1.0.4
|
||||||
|
py2: django-filter<2
|
||||||
|
drf34: djangorestframework>=3.4,<3.4.1
|
||||||
|
drf39: djangorestframework>=3.9.2,<3.10
|
||||||
|
dj111: django<2.0
|
||||||
|
dj22: django<2.3
|
||||||
|
django-tables<2.0
|
||||||
|
psycopg2-binary
|
||||||
|
oldldap: python-ldap<3
|
||||||
|
ldaptools
|
||||||
|
|
||||||
|
# pytest requirements
|
||||||
|
pytest
|
||||||
|
pytest-cov
|
||||||
|
pytest-django
|
||||||
|
pytest-freezegun
|
||||||
|
pytest-random
|
||||||
|
django-webtest
|
||||||
|
pyquery
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
py27: ./getlasso.sh
|
py2: ./getlasso.sh
|
||||||
py3: ./getlasso3.sh
|
py3: ./getlasso3.sh
|
||||||
dj111: ./pylint.sh src/authentic2_cut
|
py.test {env:COVERAGE:} {env:JUNIT:} {tty:--sw:} {posargs:tests/}
|
||||||
py.test {env:FAST:} {env:COVERAGE:} {posargs:tests/}
|
|
||||||
|
[testenv:pylint]
|
||||||
|
skip_install = True
|
||||||
|
deps =
|
||||||
|
http://git.entrouvert.org/authentic.git/snapshot/authentic-master.tar.gz
|
||||||
|
Django<2.3
|
||||||
|
pylint
|
||||||
|
pylint-django
|
||||||
|
commands =
|
||||||
|
/bin/bash -c "./pylint.sh src/*/"
|
||||||
|
|
||||||
|
[pytest]
|
||||||
|
junit_family=xunit2
|
||||||
|
filterwarnings =
|
||||||
|
error
|
||||||
|
# there is nothing we can do about that
|
||||||
|
ignore:defusedxml.lxml is no longer supported:DeprecationWarning:openpyxl.xml.functions
|
||||||
|
ignore:Using or importing the ABCs from 'collections':DeprecationWarning:django.*
|
||||||
|
ignore:Using user.is_authenticated\(\) and user.is_anonymous\(\) as a method is deprecated.::rest_framework\.*
|
||||||
|
# remind us later
|
||||||
|
once:.*staticfiles.*::django\..*
|
||||||
|
|
Loading…
Reference in New Issue