-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
54 lines (47 loc) · 1.45 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
[tox]
envlist = pep8, py312
[testenv]
setenv = VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
commands =
stestr run {posargs}
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.1}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
[testenv:pep8]
description = Run style checks.
skip_install = true
deps = pre-commit
commands = pre-commit run --all-files --show-diff-on-failure
[flake8]
show-source = True
exclude = varroa/migrations
select = H,O
# H404 Docstrings don't always start with a newline
# H405 Multiline docstrings are okay
ignore = H301,H403,H404,H405
import-order-style = pep8
application-import-names = varroa
[testenv:cover]
allowlist_externals = sh
setenv =
{[testenv]setenv}
PYTHON=coverage run --source varroa --parallel-mode
commands =
coverage erase
sh -c 'OS_TEST_PATH={toxinidir}/varroa/tests/unit stestr run {posargs}'
coverage combine
# Generate a new HTML report with the combined results
# otherwise the HTML report will only show partial results
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report --fail-under=90 --skip-covered
[testenv:genconfig]
envdir = {toxworkdir}/shared
commands =
oslo-config-generator --config-file=etc/varroa/config-generator.conf
[testenv:genpolicy]
envdir = {toxworkdir}/shared
commands =
oslopolicy-sample-generator --config-file=etc/varroa/policy-generator.conf