-
Notifications
You must be signed in to change notification settings - Fork 14
/
tox.ini
118 lines (105 loc) · 3 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
[tox]
minversion = 3.6
envlist = pep8
skipsdist = True
ignore_basepython_conflict = True
[testenv]
skip_install = True
basepython = python3
install_command = python -m pip install {opts} {packages} --upgrade pip
passenv =
OS_*
setenv =
LANG=C.UTF-8
LC_ALL=C.UTF-8
deps =
-r{toxinidir}/test-requirements.txt
commands = stestr run {posargs}
stestr slowest
[testenv:docs]
deps =
-r{toxinidir}/doc/requirements.txt
# requirements below are only required for local execution
ansible-core # ansible is required by antsibull
antsibull-docs>=0.33.0 # antsibull in zuul is installed by the job
sphinx>=4.0.0 # Sphinx in zuul is installed by the job
setenv =
ANSIBLE_COLLECTIONS_PATH={toxinidir}/../../../
allowlist_externals =
mkdir
cp
rm
commands =
rm -rf tmp/
# WARNING OF A DIRTY HACK
mkdir -m 700 -p tmp/source
antsibull-docs collection --use-current --squash-hierarchy --dest-dir tmp/source opentelekomcloud.cloud
# copy static local content on top of generated
cp -a {toxinidir}/doc/source/ tmp
# copy resulting content back to Sphinx location
#cp -av tmp/ doc/source
sphinx-build -W -d doc/build/doctrees --keep-going -b html tmp/source doc/build/html
[testenv:pep8]
commands =
flake8
[testenv:yamllint]
commands =
yamllint
[testenv:build]
deps =
pbr
ruamel.yaml
ansible-base
commands =
ansible --version
ansible-galaxy collection build --force {toxinidir} --output-path {toxinidir}/build_artifact
[testenv:linters]
passenv = *
commands =
ansible-lint -vvv
ansible --version
[testenv:sanity]
allowlist_externals =
{toxinidir}/tests/utils/sanity.sh
passenv = *
commands =
{toxinidir}/tests/utils/sanity.sh opentelekomcloud cloud
[testenv:units]
passenv = *
commands =
{toxinidir}/tests/utils/units.sh opentelekomcloud cloud
[testenv:functional]
passenv = *
commands =
{toxinidir}/tests/utils/integration.sh opentelekomcloud cloud
[testenv:venv]
deps =
-r{toxinidir}/test-requirements.txt
commands = {posargs}
[flake8]
# W503 Is supposed to be off by default but in the latest pycodestyle isn't.
# Also, both openstacksdk and Donald Knuth disagree with the rule. Line
# breaks should occur before the binary operator for readability.
# H4 are rules for docstrings. Maybe we should clean them?
# E501,E402,H301 are ignored so we can import the existing
# modules unchanged and then clean them in subsequent patches.
ignore = W503,H4,E501,E402,H301
show-source = True
exclude=.venv,.git,.tox,dist,doc,tests/output,*lib/python*,*egg,build,ansible_collections
[testenv:ansible]
# Need to pass some env vars for the Ansible playbooks
passenv =
HOME
USER
ANSIBLE_*
deps =
{[testenv]deps}
commands =
/bin/bash {toxinidir}/ci/run-ansible-tests-collection.sh -e {envdir} {posargs}
# PIP job runs with Ansible-2.9
[testenv:ansible-pip]
deps =
-r{toxinidir}/test-requirements-2.9.txt
{toxinidir}
passenv = {[testenv:ansible]passenv}
commands = {[testenv:ansible]commands}