forked from scality/metalk8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
198 lines (186 loc) · 6.36 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
[tox]
skipsdist = true
minversion = 3.18.0
requires = virtualenv >= 20.0
[testenv]
whitelist_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
commands =
bash -c ' \
pip-compile \
--emit-index-url --emit-trusted-host --annotate --generate-hashes \
--allow-unsafe \
{posargs:--upgrade} \
-o "{toxinidir}/buildchain/requirements.tmp" \
"{toxinidir}/buildchain/requirements.in" \
&& \
( \
gawk "/^[^ ]/\{e=1\}; /^pyinotify/\{e=0\}; /^macfsevents/\{e=0\}; e\{print\}" \
< "{toxinidir}/buildchain/requirements.tmp" \
&& \
cat "{toxinidir}/buildchain/platform-requirements.txt" \
) > "{toxinidir}/buildchain/requirements.txt" \
&& \
rm -f "{toxinidir}/buildchain/requirements.tmp" \
'
pip-compile \
--emit-index-url --emit-trusted-host --annotate --generate-hashes \
--allow-unsafe \
{posargs:--upgrade} \
-o "{toxinidir}/buildchain/requirements-dev.txt" \
"{toxinidir}/buildchain/requirements-dev.in"
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
deps =
-r{toxinidir}/docs/requirements.txt
commands =
doc8 docs/
{toxinidir}/docs/build.cmd {posargs:html}
passenv =
O
READTHEDOCS
setenv =
SPHINXOPTS=-j4 -n -W
[doc8]
ignore-path = docs/_build,docs/requirements.txt
ignore-path-errors = docs/installation/introduction.rst;D001
[coverage:run]
omit =
salt/_modules/metalk8s_package_manager_apt.py
[testenv:unit-tests]
description =
Run Python unit tests.
deps =
-r{toxinidir}/salt/tests/requirements.txt
commands =
pytest --cov-report=term-missing \
--cov=salt/_modules \
--cov-fail-under=100 \
{posargs} salt/tests/unit
[testenv:lint-python]
description =
Lint Python files using pylint and mypy.
# Set Python version to Python3 as shipped with RHEL/CentOS 7
basepython = python3.6
deps =
-r{toxinidir}/buildchain/requirements.txt
-r{toxinidir}/buildchain/requirements-dev.txt
commands =
bash -c " \
typed_files=( \
buildchain/dodo.py \
buildchain/buildchain \
packages/debian/download_packages.py \
); \
untyped_files=( \
salt/metalk8s/volumes/files/sparse_volume_cleanup.py \
); \
pylint $\{untyped_files[@]\} $\{typed_files[@]\}; PYLINT_RC=$?; \
mypy --strict $\{typed_files[@]\}; MYPY_RC=$?; \
if [[ $PYLINT_RC -gt 0 || $MYPY_RC -gt 0 ]]; then \
echo Failed: pylint [$PYLINT_RC] - mypy [$MYPY_RC]; exit 1; \
else \
echo Success!; \
fi \
"
[testenv:lint-shell]
description =
Lint Shell scripts using shellcheck.
whitelist_externals =
{[testenv]whitelist_externals}
shellcheck
commands =
bash -c "shellcheck $(git ls-files | grep -P '\.sh$')"
bash -c "shellcheck $(git ls-files | grep -P '\.sh\.in$')"
[testenv:lint-yaml]
description =
Lint Salt and Eve YAML files using yamllint.
deps =
yamllint==1.15.0
commands =
bash -c "yamllint eve/main.yml salt/metalk8s/defaults.yaml"
[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
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