tox.ini: refactor, add dj22 target

This commit is contained in:
Benjamin Dauvergne 2020-05-15 11:13:20 +02:00
parent 01ee94e541
commit c4a0b3cde7
2 changed files with 62 additions and 40 deletions

View File

@ -1,7 +1,7 @@
#!/bin/sh
#!/bin/bash
set -e
set -e -x
env
if [ -f /var/lib/jenkins/pylint.django.rc ]; then
PYLINT_RC=/var/lib/jenkins/pylint.django.rc
elif [ -f pylint.django.rc ]; then
@ -10,4 +10,4 @@ else
echo No pylint RC found
exit 0
fi
pylint -f parseable --rcfile ${PYLINT_RC} "$@" | tee pylint.out || /bin/true
pylint -f parseable --rcfile ${PYLINT_RC} "$@" > pylint.out || /bin/true

94
tox.ini
View File

@ -6,49 +6,71 @@
[tox]
toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/authentic2-auth-kerberos/
envlist = py27-coverage-dj111{-oldldap,},py3-coverage-dj111,pylint
envlist =
py2-dj111-drf34
py2-dj111-drf34-oldldap
py3-dj111-drf34
py3-dj22-drf39
[tox:jenkins]
envlist =
pylint
py2-dj111-drf34
py3-dj111-drf34
py3-dj22-drf39
[testenv]
whitelist_externals =
/bin/mv
/bin/rm
setenv =
AUTHENTIC2_SETTINGS_FILE=tests/settings.py
DJANGO_SETTINGS_MODULE=authentic2.settings
DB_ENGINE=postgresql_psycopg2
AUTHENTIC2_SETTINGS_FILE=tests/settings.py
DJANGO_SETTINGS_MODULE=authentic2.settings
DB_ENGINE=postgresql_psycopg2
JUNIT={tty::-o junit_suite_name={envname} --junit-xml=junit-{envname}.xml}
coverage: COVERAGE=--cov=src --cov-branch --cov-append --cov-report xml --cov-report html
# support for pg_virtualenv
PGPORT={env:PGPORT:}
PGHOST={env:PGHOST:}
PGUSER={env:PGUSER:}
PGPASSWORD={env:PGPASSWORD:}
usedevelop =
coverage: true
JUNIT={tty::-o junit_suite_name={envname} --junit-xml=junit-{envname}.xml}
COVERAGE={tty::--junitxml=test_{envname}_results.xml --cov-report xml --cov-report html --cov=src/ --cov-config .coveragerc}
passenv=
BRANCH_NAME
# support for pg_virtualenv
PGPORT
PGHOST
PGUSER
PGPASSWORD
usedevelop = true
deps =
dj111: django>1.11,<1.12
dj111: django-tables<2.0
psycopg2-binary
pytest>=3.3.0
pytest-cov
pytest-random
pytest-django
ldaptools
http://git.entrouvert.org/authentic.git/snapshot/authentic-master.tar.bz2
oldldap: python-ldap<3
django-webtest
py27: django-appconf<1.0.4
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-random
django-webtest
pyquery
commands =
py27: ./getlasso.sh
py3: ./getlasso3.sh
py.test {env:COVERAGE:} {env:JUNIT:} {posargs:tests}
py2: ./getlasso.sh
py3: ./getlasso3.sh
py.test {env:COVERAGE:} {env:JUNIT:} {tty:--sw:} {posargs:tests/}
[testenv:pylint]
basepython = python2.7
skip_install = True
deps =
pylint<1.8
pylint-django<0.8.1
http://git.entrouvert.org/authentic.git/snapshot/authentic-master.tar.gz
Django<2.3
pylint
pylint-django
commands =
pylint: ./pylint.sh src/authentic2_auth_kerberos/
/bin/bash -c "./pylint.sh src/*/"
[pytest]
junit_family=xunit2