-
Notifications
You must be signed in to change notification settings - Fork 113
/
tox.ini
156 lines (140 loc) · 4.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
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
[tox]
minversion = 1.6
envlist = linters,gerrit,grafyaml
skipsdist = True
[testenv]
passenv =
http_proxy
HTTP_PROXY
https_proxy
HTTPS_PROXY
no_proxy
NO_PROXY
basepython = python3
[testenv:linters]
allowlist_externals =
bash
{toxinidir}/tools/ansible-lint-roles-cache.sh
{toxinidir}/tools/run-bashate.sh
{toxinidir}/tools/zuul-projects-checks.py
setenv =
# NOTE(ianw) : In the gate job openstack-zuul-jobs-linters this is
# overridden to the Zuul checkouts of the projects. Locally,
# tools/ansible-lint-roles-cache.sh will populate these for the
# linter.
ANSIBLE_ROLES_PATH={env:ANSIBLE_ROLES_PATH:{toxinidir}/.cache/ansible-lint/opendev/base-jobs/roles:{toxinidir}/.cache/ansible-lint/opendev/system-config/roles:{toxinidir}/.cache/ansible-lint/zuul/zuul-jobs/roles:{toxinidir}/.cache/ansible-lint/openstack/openstack-zuul-jobs/roles}
# Add dependencies here since other jobs use python2 and zuul requires
# python3.
deps =
# ansible-lint brings in the latest version of ansible, but we
# keep this in sync with what Zuul uses so we don't allow though
# things from a later ansible that would actually fail in
# production.
ansible>=8,<9
ansible-lint<25.0.0
hacking>=7.0.0,<8.0.0
bashate>=0.2
commands =
{toxinidir}/tools/ansible-lint-roles-cache.sh
{toxinidir}/tools/run-bashate.sh
flake8
# Run some policy checks on zuul.d/projects.yaml
{toxinidir}/tools/zuul-projects-checks.py
# Ansible lint
bash -c "find playbooks -type f -regex '.*.ya?ml' -print0 | \
xargs -t -0 ansible-lint"
bash -c "find roles -maxdepth 1 -mindepth 1 -type d -printf '%p/\n' | \
xargs -t ansible-lint"
# Make sure site-variables at least parses
python -c 'import yaml ; yaml.safe_load(open("zuul/site-variables.yaml", "r"))'
[testenv:gerrit]
allowlist_externals =
{toxinidir}/tools/check_valid_gerrit_projects.py
{toxinidir}/tools/check_projects_yaml_alphabetized.sh
{toxinidir}/tools/check_valid_gerrit_config.sh
deps =
PyYAML
ruamel.yaml
GitPython
commands =
{toxinidir}/tools/check_valid_gerrit_projects.py gerrit/projects.yaml gerrit/acls zuul/main.yaml
{toxinidir}/tools/check_projects_yaml_alphabetized.sh gerrit/projects.yaml
{toxinidir}/tools/check_valid_gerrit_config.sh
[testenv:venv]
commands = {posargs}
[testenv:irc]
allowlist_externals =
{toxinidir}/tools/check_irc_access.py
{toxinidir}/tools/irc_tests.py
{toxinidir}/tools/check-channels-yaml.sh
deps =
PyYAML
ruamel.yaml
irc
commands =
{toxinidir}/tools/check_irc_access.py -l accessbot/channels.yaml opendevaccess
{toxinidir}/tools/irc_tests.py
{toxinidir}/tools/check-channels-yaml.sh
[flake8]
show-source = True
exclude = .tox,.test,.cache
# These are ignored intentionally in openstack-infra projects;
# please don't submit patches that solely correct them or enable them.
ignore = E125,E129,E402,H,W503
[testenv:grafyaml]
deps =
{env:GRAFYAML_SRC:git+https://opendev.org/opendev/grafyaml#egg=grafyaml}
commands = grafana-dashboard validate grafana
[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files.
deps = bindep
commands = bindep test
[testenv:infra-docs]
allowlist_externals =
{toxinidir}/docs-site/generate_infra_index.py
deps =
Jinja2
PyYAML
commands = {toxinidir}/docs-site/generate_infra_index.py {toxinidir}/docs-site/infra-documents.yaml
[testenv:specs]
allowlist_externals =
{toxinidir}/specs/generate_specs_site.py
deps =
Jinja2
PyYAML
commands = {toxinidir}/specs/generate_specs_site.py {toxinidir}/specs/specs.yaml
[testenv:dib]
allowlist_externals =
env
deps =
diskimage-builder
yamllint
changedir = {toxinidir}/nodepool
commands = env ELEMENTS_DIR=elements dib-lint
[testenv:nodepool]
allowlist_externals =
{toxinidir}/tools/nodepool-validate.sh
deps = nodepool
commands =
{toxinidir}/tools/nodepool-validate.sh
[testenv:add-projects-to-main]
allowlist_externals =
git
deps =
ruamel.yaml
commands =
python tools/add-projects-to-main.py
git diff-files --quiet
[testenv:normalize-gerrit-acl]
commands =
python {toxinidir}/tools/normalize_acl.py {posargs} apply
[testenv:normalize-projects-yaml]
allowlist_externals =
{toxinidir}/tools/normalize_projects_yaml.py
deps =
ruamel.yaml
commands =
{toxinidir}/tools/normalize_projects_yaml.py