-
Notifications
You must be signed in to change notification settings - Fork 697
/
tox.ini
174 lines (154 loc) · 5.34 KB
/
tox.ini
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
[tox]
minversion = 3.18.0
envlist = py3,pep8,api-ref,docs,genconfig,genpolicy,releasenotes,protection
ignore_basepython_conflict = true
[testenv]
basepython = python3
usedevelop = True
setenv =
PYTHONDONTWRITEBYTECODE=1
# TODO(stephenfin): Remove once we bump our upper-constraint to SQLAlchemy 2.0
SQLALCHEMY_WARN_20=1
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
.[ldap,memcache]
commands =
stestr run {posargs}
allowlist_externals =
bash
passenv = http_proxy,HTTP_PROXY,https_proxy,HTTPS_PROXY,no_proxy,NO_PROXY,PBR_VERSION
[testenv:pep8]
deps =
{[testenv]deps}
pre-commit
commands =
pre-commit run --all-files --show-diff-on-failure
# Run bash8 during pep8 runs to ensure violations are caught by
# the check and gate queues
bashate devstack/plugin.sh
[testenv:fast8]
deps = {[testenv:pep8]deps}
commands =
{toxinidir}/tools/fast8.sh
passenv = FAST8_NUM_COMMITS
allowlist_externals = {toxinidir}/tools/fast8.sh
[testenv:bandit]
# NOTE(browne): This is required for the integration test job of the bandit
# project. Please do not remove.
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
commands = bandit -r keystone -x 'keystone/tests/*'
[testenv:cover]
# Also do not run test_coverage_ext tests while gathering coverage as those
# tests conflict with coverage.
setenv =
{[testenv]setenv}
PYTHON=coverage run --source keystone --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:patch_cover]
commands =
bash tools/cover.sh
[testenv:venv]
commands = {posargs}
[testenv:debug]
commands =
oslo_debug_helper {posargs}
passenv = KSTEST_*
[testenv:functional]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
setenv = OS_TEST_PATH=./keystone/tests/functional
commands =
stestr run {posargs}
stestr slowest
passenv = KSTEST_*
[flake8]
# We only enable the hacking (H)
select = H
application-import-names = keystone
import-order-style = pep8
filename = *.py,keystone-manage
show-source = true
enable-extensions = H203,H904
# D100: Missing docstring in public module
# D101: Missing docstring in public class
# D102: Missing docstring in public method
# D103: Missing docstring in public function
# D104: Missing docstring in public package
# D106: Missing docstring in public nested class
# D107: Missing docstring in __init__
# D203: 1 blank line required before class docstring (deprecated in pep257)
# D401: First line should be in imperative mood; try rephrasing
# E402: module level import not at top of file
# H211: Use assert{Is,IsNot}instance
# H214: Use assertIn/NotIn(A, B) rather than assertTrue/False(A in/not in B) when checking collection contents.
# W503: line break before binary operator
# W504: line break after binary operator
ignore = D100,D101,D102,D103,D104,D106,D107,E203,D203,D401,E402,H211,H214,W503,W504
exclude = .venv,.git,.tox,build,dist,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot
max-complexity = 24
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
.[ldap,memcache]
commands=
bash -c "rm -rf doc/build"
bash -c "rm -rf doc/source/api"
sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
# FIXME(gyee): we need to pre-create the doc/build/pdf/_static directory as a
# workaround because sphinx_feature_classification.support_matrix extension
# is operating under the assumption that the _static directory already exist
# and trying to copy support-matrix.css into it. We need to remove
# the workaround after this patch has merged:
# https://review.opendev.org/#/c/679860
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
make
mkdir
rm
commands =
rm -rf doc/build/pdf
mkdir -p doc/build/pdf/_static
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:releasenotes]
deps = {[testenv:docs]deps}
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:api-ref]
deps = {[testenv:docs]deps}
commands =
bash -c "rm -rf api-ref/build"
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:genconfig]
commands = oslo-config-generator --config-file=config-generator/keystone.conf
[testenv:genpolicy]
commands = oslopolicy-sample-generator --config-file config-generator/keystone-policy-generator.conf
[hacking]
import_exceptions =
keystone.i18n
[flake8:local-plugins]
extension =
K001 = checks:CheckForMutableDefaultArgs
K002 = checks:block_comments_begin_with_a_space
K005 = checks:CheckForTranslationIssues
K008 = checks:dict_constructor_with_sequence_copy
paths = ./keystone/tests/hacking
[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files.
deps = bindep
commands = bindep test
[testenv:protection]
commands =
stestr run --test-path=./keystone/tests/protection {posargs}