# Tox (http://tox.testrun.org/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the # test suite on all supported python versions. To use it, "pip install tox" # and then run "tox" from this directory. [tox] toxworkdir = {env:TMPDIR:/tmp}/tox-{env:USER}/authentic/ envlist = update-locales py3 py3-buster py3-bullseye py3-stable-backports check-migrations code-style pylint labels = jenkins = update-locales,py3-bullseye,check-migrations,code-style,pylint [testenv] setenv = NUMPROCESSES={env:NUMPROCESSES:1} AUTHENTIC2_SETTINGS_FILE=tests/settings.py DJANGO_SETTINGS_MODULE=authentic2.settings TESTS=tests/ DB_ENGINE=django.db.backends.postgresql_psycopg2 SETUPTOOLS_USE_DISTUTILS=stdlib JUNIT={tty::-o junit_suite_name={envname} --junit-xml=junit-{envname}.xml} COVERAGE={tty::--cov --cov-append --cov-report xml --cov-report html --cov-config=tox.ini} fast: FAST=--nomigrations reusedb: REUSEDB=--reuse-db passenv= BRANCH_NAME # support for pg_virtualenv PGPORT PGHOST PGUSER PGPASSWORD # to customize pytest running in your locale environment, ex.: # export PYTESTOPTIONS=--sw PYTESTOPTIONS deps = pip > 9 buster: django<2.3 buster: django-model-utils<4 buster: django-select2>=5,<6 buster: dnspython==1.16.0 # impossible to compile old version of pillow on recent debian :/ or to install # python3.6, the version of python on buster # buster: pillow==5.4.1 bullseye: django<2.3 bullseye: django-model-utils<4 bullseye: dnspython==2.0.0 bullseye: django-select2>=5,<6 bullseye: pillow==8.1.2 stable-backports: django>=3.2.12,<3.3 stable-backports: django-model-utils>=4.2,<4.3 stable-backports: django-select2>=7.7,<7.8 buster: django-tables2==1.21.1 bullseye: django-tables2==2.1.1 stable-backports: django-tables2==2.4.1 psycopg2-binary buster: psycopg2-binary<2.9 bullseye: psycopg2-binary<2.9 coverage pytest-cov pytest-django pytest-random pytest-xdist mock<4 pytest!=5.3.3 lxml cssselect django-webtest Markdown<3 WebTest pyquery httmock pytz pytest-freezegun faker uwsgidecorators enum34<=1.1.6 ldaptools>=0.24 numpy django-filter buster: djangorestframework>=3.9.2,<3.10 bullseye: djangorestframework>=3.12,<3.13 stable-backports: djangorestframework>=3.12,<3.13 buster: jwcrypto<0.9 bullseye: jwcrypto<0.9 stable-backports: jwcrypto<0.9 usedevelop = True allowlist_externals = ./getlasso3.sh commands = ./getlasso3.sh py.test {env:PYTESTOPTIONS:} {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {env:JUNIT:} {env:SW:} {posargs:{env:TESTS} --numprocesses {env:NUMPROCESSES:1} --random-group} [testenv:check-migrations] basepython = python3 usedevelop = True setenv = DJANGO_SETTINGS_MODULE=authentic2.settings SETUPTOOLS_USE_DISTUTILS=stdlib deps = psycopg2-binary<2.9 allowlist_externals = ./getlasso3.sh ./check-migrations.sh commands = ./getlasso3.sh ./check-migrations.sh [testenv:pylint] basepython = python3 setenv = DJANGO_SETTINGS_MODULE=authentic2.settings SETUPTOOLS_USE_DISTUTILS=stdlib NUMPROCESSES={env:NUMPROCESSES:1} deps = pylint pylint-django psycopg2-binary<2.9 django_webtest faker httmock lxml ldaptools pytest uwsgidecorators pyquery numpy allowlist_externals = ./getlasso3.sh ./pylint.sh commands = ./getlasso3.sh ./pylint.sh {posargs:tests/ src/} [testenv:manage] usedevelop = True setenv = DJANGO_SETTINGS_MODULE=authentic2.settings AUTHENTIC2_SETTINGS_FILE=local_settings.py deps = psycopg2-binary<2.9 django-debug-toolbar ipython ipdb allowlist_externals = ./getlasso3.sh ./manage.py commands = ./getlasso3.sh ./manage.py {posargs:--help} [testenv:update-locales] usedevelop = True setenv = DJANGO_SETTINGS_MODULE=authentic2.settings deps = psycopg2-binary<2.9 allowlist_externals = ./getlasso3.sh ./manage.py commands = ./getlasso3.sh ./manage.py makemessages -l fr -i tests ./manage.py compilemessages [testenv:code-style] skip_install = true deps = pre-commit commands = pre-commit run --all-files --show-diff-on-failure [pytest] filterwarnings = ignore once:::authentic2.* error:.*please use dns.resolver.resolve:DeprecationWarning: error:.*Passing None for the middleware get_response argument is deprecated.*:: error:.*ANTIALIAS is deprecated and will be removed in Pillow 10:: error:.*LANCZOS.*Pillow 10:: junit_family=xunit2 [coverage:run] source = authentic2 authentic2_auth_fc authentic2_auth_oidc authentic2_auth_saml authentic2_idp_cas authentic2_idp_oidc django_rbac branch = True dynamic_context = test_function [coverage:html] show_contexts = True