-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
83 lines (76 loc) · 2.6 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
[tox]
minversion = 1.6
envlist = linters
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/run-bashate.sh
{toxinidir}/tools/zuul-projects-checks.py
setenv =
ANSIBLE_LIBRARY= {toxinidir}/tests/fake-ansible:{toxinidir}/playbooks/library
# NOTE(pabelanger): if you'd like to run tox -elinters locally,
# you'll need to export ANSIBLE_ROLES_PATH pointing to the required
# repos.
#
# We take a guess that zuul-jobs and openstack-zuul-jobs will be
# checked out in the directory above us (i.e. alongside
# project-config). You may need to override this. Make sure
# they're up to date too!
#
# see openstack-zuul-jobs-linters job for more information.
ANSIBLE_ROLES_PATH={env:ANSIBLE_ROLES_PATH:../../../opendev.org/zuul/zuul-jobs/roles:../otc-zuul-jobs/roles: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>=2.9,<2.11
ansible-lint>=5.0.0,<6.0.0
hacking>=4.0.0,<5.0.0
bashate>=0.2
commands =
{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 -n1 -0 ansible-lint"
bash -c 'find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \
xargs -t -n1 ansible-lint'
# Ansible Syntax Check
bash -c "find playbooks -type f -regex '.*.ya?ml' -exec \
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \
-e @tests/vars.yaml \{\} + > /dev/null"
[testenv:venv]
commands = {posargs}
[testenv:docs]
deps =
-r{toxinidir}/doc/requirements.txt
commands =
sphinx-build -E -W -d doc/build/doctrees -b html doc/source/ doc/build/html
[flake8]
show-source = True
exclude = .tox,.test
# 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: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