-
Notifications
You must be signed in to change notification settings - Fork 45
/
tox.ini
202 lines (187 loc) · 6.33 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
[tox]
skipsdist = true
minversion = 3.18.0
# New virtualenv version does not support python3.6
requires = virtualenv < 20.22.0
isolated_build = true
[testenv]
allowlist_externals = bash
basepython = python3
skip_install = true
setenv =
VIRTUALENV_NO_DOWNLOAD=1
[testenv:pip-compile]
description =
Update the requirements.txt files.
basepython = python3.6
skip_install = true
deps =
pip==20.3.3
pip-tools==5.4.0
setenv =
CUSTOM_COMPILE_COMMAND = tox -e pip-compile
allowlist_externals =
gawk
bash
commands =
pip-compile \
--emit-index-url --emit-trusted-host --annotate \
--allow-unsafe \
{posargs:--upgrade} \
-o "{toxinidir}/buildchain/requirements.txt" \
"{toxinidir}/buildchain/requirements.in"
# Remove pyinotify and/or macfsevents
gawk -i inplace -- "/^[^ ]/\{e=1\}; /^pyinotify/\{e=0\}; /^macfsevents/\{e=0\}; e\{print\}" "{toxinidir}/buildchain/requirements.txt"
# Add pyinotify and macfsevents from platform-requirements.txt
bash -c 'cat "{toxinidir}/buildchain/platform-requirements.txt" >> "{toxinidir}/buildchain/requirements.txt"'
pip-compile \
--emit-index-url --emit-trusted-host --annotate \
--allow-unsafe \
{posargs:--upgrade} \
-o "{toxinidir}/docs/requirements.txt" \
"{toxinidir}/docs/requirements.in"
pip-compile \
--emit-index-url --emit-trusted-host --annotate --generate-hashes \
--allow-unsafe \
{posargs:--upgrade} \
-o "{toxinidir}/tests/requirements.txt" \
"{toxinidir}/tests/requirements.in"
pip-compile \
--emit-index-url --emit-trusted-host --annotate --generate-hashes \
--allow-unsafe \
{posargs:--upgrade} \
-o "{toxinidir}/salt/tests/requirements.txt" \
"{toxinidir}/salt/tests/requirements.in"
[testenv:docs]
description = Render and lint documentation.
skip_install = true
allowlist_externals = {toxinidir}/docs/build.cmd
deps =
-r{toxinidir}/docs/requirements.txt
commands =
doc8 docs/
{toxinidir}/docs/build.cmd {posargs:html}
passenv =
READTHEDOCS
setenv =
O = -W {env:O:}
[testenv:alert-tree]
description = Interact with MetalK8s alerts as a tree.
allowlist_externals = poetry
changedir = {toxinidir}/tools/lib-alert-tree
commands =
poetry install -q -E cli --no-dev --remove-untracked
poetry run python -m metalk8s {posargs:"--help"}
[testenv:compile-alert-tree-deps]
description = Lock lib_alert_tree dependencies and export as a requirements.txt file.
allowlist_externals = poetry
changedir = {toxinidir}/tools/lib-alert-tree
commands =
poetry lock
poetry export -o requirements.txt -E cli --without-hashes
[doc8]
ignore-path = docs/_build,docs/requirements.txt
ignore-path-errors = docs/installation/introduction.rst;D001
[testenv:unit-tests]
basepython = python3.6
description =
Run Python unit tests.
deps =
-r{toxinidir}/salt/tests/requirements.txt
commands =
pytest --cov-report=term-missing \
--cov=salt/_modules \
--cov=salt/_runners \
--cov-fail-under=100 \
{posargs} salt/tests/unit
[testenv:pre-commit]
description =
Run pre-commit hook
deps =
pre-commit
# New virtualenv version does not support python3.6
virtualenv < 20.22.0
commands =
bash -c "pre-commit run {posargs}"
[testenv:lint]
description =
Lint all files using pre-commit
deps =
pre-commit
# New virtualenv version does not support python3.6
virtualenv < 20.22.0
commands =
bash -c "pre-commit run --all-files {posargs}"
[testenv:lint-shell]
description =
Lint Shell scripts using shellcheck.
allowlist_externals =
{[testenv]allowlist_externals}
shellcheck
commands =
bash -c "shellcheck $(git ls-files | grep -P '\.sh$')"
bash -c "shellcheck $(git ls-files | grep -P '\.sh\.in$')"
[testenv:chart-render]
description =
Run the chart render script
allowlist_externals =
{toxinidir}/charts/render.py
deps =
pyyaml
commands =
{toxinidir}/charts/render.py {posargs}
[testenv:tests]
description =
Run tests suite remotely (uses local Vagrant configuration by default).
deps =
-r{toxinidir}/tests/requirements.txt
passenv =
SSH_CONFIG_FILE
TEST_HOSTS_LIST
ISO_MOUNTPOINT
BOOTSTRAP_BACKUP_ARCHIVE
CONTROL_PLANE_INGRESS_VIP
WORKLOAD_PLANE_INGRESS_VIPS
setenv =
VAGRANT_CWD={toxinidir}
commands_pre =
- bash -c "vagrant ssh-config > {envdir}/vagrant_ssh_config"
commands =
pytest \
--ssh-config={env:SSH_CONFIG_FILE:{envdir}/vagrant_ssh_config} \
--hosts={env:TEST_HOSTS_LIST:bootstrap} \
--iso-root={env:ISO_MOUNTPOINT:/vagrant/_build/root} \
{posargs:-m local} tests
[testenv:tests-local]
description =
Run tests suite on the bootstrap node of an installation.
deps = {[testenv:tests]deps}
passenv =
ISO_MOUNTPOINT
BOOTSTRAP_BACKUP_ARCHIVE
commands =
pytest \
--iso-root={env:ISO_MOUNTPOINT:_build/root} \
{posargs:-m local} tests
[pytest]
bdd_strict_gherkin = false
markers =
ci: tag a BDD feature as part of CI test suite
install: tag a BDD feature as an installation scenario
local: tag a BDD feature as part of local test suite
multinodes: tag a BDD feature requiring more than one node to run
post: tag a BDD feature as a post-installation test
slow: tag a BDD feature as a long running test
ui: tag a BDD feature as related to MetalK8s UI
salt: tag a BDD feature as related to Salt operations
monitoring: tag a BDD feature as related to monitoring
ingress: tag a BDD feature as related to ingress
volume: tag a BDD feature as related to Volume management
bootstrap: tag a BDD feature as related to bootstrap
authentication: tag a BDD feature as related to authentication
csc: tag a BDD feature related to Cluster and Service configuration
solution: tag a BDD feature as related to solution
restore: tag a BDD feature as related to bootstrap node recovery
filterwarnings =
ignore:encode_point has been deprecated on EllipticCurvePublicNumbers and will be removed in a future version. Please use EllipticCurvePublicKey.public_bytes to obtain both compressed and uncompressed point encoding.:UserWarning
ignore:Support for unsafe construction of public numbers from encoded data will be removed in a future version. Please use EllipticCurvePublicKey.from_encoded_point:UserWarning