summaryrefslogtreecommitdiffstats
path: root/tox.ini
blob: e858123e7a8dc9ab084ca59efeac54d89b4af36e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# 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 =
  rbac-py3-{dj111,dj22}

  authentic-py3-dj111-drf34
  authentic-py3-dj22-drf39

[tox:jenkins]
envlist =
  pylint

  rbac-py3-dj22
  authentic-py3-dj111-drf34
  authentic-py3-dj22-drf39

[testenv]
whitelist_externals =
  /bin/mv
setenv =

  authentic: AUTHENTIC2_SETTINGS_FILE=tests/settings.py
  authentic: DJANGO_SETTINGS_MODULE=authentic2.settings
  rbac: DJANGO_SETTINGS_MODULE=django_rbac.test_settings

  authentic: TESTS=tests/
  authentic-oldldap: TESTS=tests/test_ldap.py
  rbac: TESTS=tests_rbac/

  DB_ENGINE=django.db.backends.postgresql_psycopg2

  JUNIT={tty::-o junit_suite_name={envname} --junit-xml=junit-{envname}.xml}
  COVERAGE={tty::--cov=src --cov-branch --cov-append --cov-report xml --cov-report html}
  fast: FAST=--nomigrations
  reusedb: REUSEDB=--reuse-db
  !nosw: SW={tty:--sw:}
passenv=
  BRANCH_NAME
  # support for pg_virtualenv
  PGPORT
  PGHOST
  PGUSER
  PGPASSWORD
usedevelop = true
deps = 
  pip > 9
  dj111: django<2.0
  dj22: django<2.3
  django-tables<2.0
  psycopg2-binary
  coverage
  pytest-cov
  pytest-django<3.4.6
  pytest-random
  mock
  pytest<5
  lxml
  cssselect
  django-webtest
  Markdown<3
  WebTest
  pyquery
  httmock
  pytz
  pytest-freezegun
  enum34<=1.1.6
  ldaptools>=0.15
  oldldap: python-ldap<3
  py2: django-appconf<1.0.4
  py2: django-filter<2
  py3: django-filter<2.3
  drf34: djangorestframework>=3.4,<3.4.1
  drf39: djangorestframework>=3.9.2,<3.10
commands =
  py2: ./getlasso.sh
  py3: ./getlasso3.sh
  authentic: ./check-migrations.sh
  rbac,authentic: py.test {env:FAST:} {env:REUSEDB:} {env:COVERAGE:} {env:JUNIT:} {env:SW:} {posargs:{env:TESTS} --random-group}

[testenv:pylint]
basepython = python2.7
deps =
    pylint<1.8
    pylint-django<0.8.1
commands =
    /bin/bash -c "./pylint.sh src/*/"

[testenv:manage]
usedevelop = True
setenv =
  DJANGO_SETTINGS_MODULE=authentic2.settings
  AUTHENTIC2_SETTINGS_FILE=local_settings.py
deps =
  psycopg2-binary
  django-debug-toolbar
  ipython
  ipdb
commands =
    ./getlasso3.sh
    ./authentic2-ctl {posargs:--help}

[pytest]
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:Role QuerySet won't use Meta.ordering::django\..*
  ignore:Using user.is_authenticated\(\) and user.is_anonymous\(\) as a method is deprecated.::rest_framework\.*
  ignore:Rendering.*raised KeyError::django\.template\.loader_tags
# warning of gettext() when using Django 1.11 with Python 3.8
  ignore:set_output_charset\(\) is deprecated::django.utils.translation.trans_real
  ignore:parameter codeset is deprecated::django.utils.translation.trans_real
# remind us later
  once:.*staticfiles.*::django\..*
junit_family=xunit2