-
Notifications
You must be signed in to change notification settings - Fork 680
/
tox.ini
160 lines (142 loc) · 4.66 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
[tox]
minversion = 3.1
skipsdist = True
envlist = linters,docs,releasenotes,inventory,py3-inventory
ignore_basepython_conflict = True
[testenv]
usedevelop = True
basepython = python3
install_command =
pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages}
deps =
-r{toxinidir}/global-requirement-pins.txt
-r{toxinidir}/test-requirements.txt
passenv =
COMMON_TESTS_PATH
HOME
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
TESTING_BRANCH
TESTING_HOME
USER
allowlist_externals =
bash
setenv =
PYTHONUNBUFFERED=1
PYTHONWARNINGS=default::DeprecationWarning
VIRTUAL_ENV={envdir}
WORKING_DIR={toxinidir}
ANSIBLE_EXTRA_ROLE_DIRS={toxinidir}/playbooks/roles:{homedir}/.ansible/roles/ceph-ansible/roles
ANSIBLE_ROLE_REQUIREMENTS_PATH={toxinidir}/ansible-role-requirements.yml
TEST_PLAYBOOK={toxinidir}/tests/bootstrap-aio.yml {toxinidir}/playbooks/setup-everything.yml
ANSIBLE_LINT_PARAMS=--exclude={homedir}/.ansible/roles
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt
commands =
doc8 doc
docstheme-build-translated.sh
setenv =
SPHINX_WARNINGS_TRANS=1
[testenv:deploy-guide]
deps = -r{toxinidir}/doc/requirements.txt
commands = sphinx-build -a -E -W -d deploy-guide/build/doctrees --keep-going -b html deploy-guide/source deploy-guide/build/html
[testenv:deploy-guide-pdf-docs]
deps = {[testenv:deploy-guide]deps}
allowlist_externals =
make
commands =
sphinx-build -W --keep-going -b latex deploy-guide/source deploy-guide/build/pdf
make -C deploy-guide/build/pdf
[testenv:pdf-docs]
deps = {[testenv:docs]deps}
allowlist_externals =
make
commands =
sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
make -C doc/build/pdf
[doc8]
# Settings for doc8:
extensions = .rst
ignore = D001
[testenv:releasenotes]
deps = -r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
# environment used by the -infra templated docs job
[testenv:venv]
commands =
{posargs}
[testenv:pep8]
commands =
bash -c "{toxinidir}/tests/common/test-pep8.sh"
[flake8]
# Ignores the following rules due to how ansible modules work in general
# F403 'from ansible.module_utils.basic import *' used;
# unable to detect undefined names
# E124 closing bracket does not match visual indentation
# W503 line break before binary operator
ignore=F403,E124,W503
[testenv:bashate]
commands =
bash -c "{toxinidir}/tests/common/test-bashate.sh"
# The deps URL should be set to the appropriate git URL.
# In the tests repo itself, the variable is uniquely set to
# the toxinidir so that the role is able to test itself, but
# the tox config is exactly the same as other repositories.
#
# The value for other repositories must be:
# https://opendev.org/openstack/openstack-ansible-tests/raw/test-ansible-deps.txt
# or for a stable branch:
# https://opendev.org/openstack/openstack-ansible-tests/raw/stable/stein/test-ansible-deps.txt
[testenv:ansible]
deps =
{[testenv]deps}
-r{toxinidir}/global-requirement-pins.txt
-rhttps://opendev.org/openstack/openstack-ansible-tests/raw/test-ansible-deps.txt
[testenv:ansible-syntax]
deps =
{[testenv:ansible]deps}
commands =
bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh"
[testenv:ansible-lint]
deps =
{[testenv:ansible]deps}
commands =
bash -c "{toxinidir}/tests/common/test-ansible-lint.sh"
[testenv:inventory]
# Use a fixed seed since some inventory tests rely on specific ordering
deps =
{[testenv]deps}
-e .
# NOTE(noonedeadpunk): Overriding install_command is a temporary solution until `requests` module version
# will be updated in u-c as it's incompatible with ansible-lint requirements.
install_command = pip install {opts} {packages}
setenv =
{[testenv]setenv}
PYTHONHASHSEED = 100
commands =
coverage erase
coverage run -a {toxinidir}/tests/test_inventory.py
coverage run -a {toxinidir}/tests/test_manage.py
coverage run -a {toxinidir}/tests/test_dictutils.py
coverage run -a {toxinidir}/tests/test_ip.py
coverage run -a {toxinidir}/tests/test_filesystem.py
coverage report --show-missing --include={toxinidir}/inventory/*,{toxinidir}/osa_toolkit/*
[testenv:py3-inventory]
setenv =
{[testenv:inventory]setenv}
commands =
{[testenv:inventory]commands}
[testenv:linters]
deps =
{[testenv:ansible]deps}
commands =
{[testenv:pep8]commands}
{[testenv:bashate]commands}
{[testenv:ansible-lint]commands}
{[testenv:ansible-syntax]commands}
{[testenv:inventory]commands}