-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathtox.ini
175 lines (156 loc) · 5.06 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
175
[tox]
minversion = 3.18.0
envlist = py38,py39,pep8,docs
[testenv]
setenv =
PYTHON=coverage run --source barbican --parallel-mode
PYTHONDONTWRITEBYTECODE=1
usedevelop = True
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands =
oslo-config-generator --config-file etc/oslo-config-generator/barbican.conf --output-file etc/barbican/barbican.conf
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report -m
[testenv:cover]
deps =
{[testenv]deps}
diff_cover
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
diff-cover --fail-under 100 --compare-branch master cover/coverage.xml
[testenv:releasenotes]
deps = {[testenv:docs]deps}
allowlist_externals =
rm
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8]
sitepackages = False
commands =
doc8 {posargs}
flake8 {posargs}
# Run security linter
bandit -r barbican -x tests -n5 -s B105
[testenv:genconfig]
commands =
oslo-config-generator --config-file etc/oslo-config-generator/barbican.conf
[testenv:venv]
commands = {posargs}
[testenv:debug]
commands = oslo_debug_helper -t barbican/tests {posargs}
[testenv:docs]
# This environment is called from CI scripts to test and publish
# the main docs to https://docs.openstack.org/barbican
description = Build main documentation
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands=
rm -rf doc/build doc/build/doctrees
sphinx-build -W -b html doc/source doc/build/html
allowlist_externals =
rm
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
make
commands =
sphinx-build -W -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[testenv:api-guide]
# This environment is called from CI scripts to test and publish
# the API Guide to docs.openstack.org.
deps = {[testenv:docs]deps}
commands =
rm -rf api-guide/build
sphinx-build -W -b html -d api-guide/build/doctrees api-guide/source api-guide/build/html
allowlist_externals =
rm
[testenv:all-docs]
description = Build all documentation
deps = {[testenv:docs]deps}
commands=
{[testenv:docs]commands}
{[testenv:api-guide]commands}
{[testenv:releasenotes]commands}
allowlist_externals =
rm
[testenv:functional]
# This tox env is purely to make local test development easier
# Note: This requires local running instances of Barbican and Keystone
# TODO(dmend): remove --serial and uncomment coverage commands
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
setenv =
OS_TEST_PATH={toxinidir}/functionaltests
commands =
/usr/bin/find . -type f -name "*.py[c|o]" -delete
stestr run --serial --slowest {posargs}
# coverage combine
# coverage html -d cover
# coverage xml -o cover/coverage.xml
allowlist_externals =
/usr/bin/find
passenv = KMIP_PLUGIN_ENABLED
VAULT_PLUGIN_ENABLED
PKCS11_PLUGIN_ENABLED
[testenv:cmd]
# This tox env is purely to make local test development easier
# Note: This requires local running instances of Barbican and Keystone
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
setenv =
OS_TEST_PATH={toxinidir}/barbican/cmd/functionaltests
commands =
/usr/bin/find . -type f -name "*.py[c|o]" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
allowlist_externals =
/usr/bin/find
[doc8]
ignore = D001
ignore-path = .venv,.git,.tox,.tmp,*barbican/locale*,*lib/python*,barbican.egg*,doc/build,releasenotes/*,doc/source/contributor/api
[flake8]
filename = *.py,app.wsgi
exclude = .git,.idea,.tox,bin,dist,debian,rpmbuild,tools,*.egg-info,*.eggs,contrib,
*docs/target,*.egg,build
# E402 module level import not at top of file
# W503 line break before binary operator
# W504 line break after binary operator
ignore = E402,W503,W504,
[testenv:bandit]
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r barbican -x tests -n5
[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:genpolicy]
commands = oslopolicy-sample-generator --config-file=etc/oslo-config-generator/policy.conf
[flake8:local-plugins]
extension =
B310 = checks:CheckLoggingFormatArgs
B317 = checks:check_oslo_namespace_imports
B318 = checks:dict_constructor_with_list_copy
B320 = checks:no_log_warn_check
paths = ./barbican/hacking