-
Notifications
You must be signed in to change notification settings - Fork 18
/
tox.ini
81 lines (75 loc) · 2.34 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
[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
# 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.
#
# https://github.com/ansible-community/ansible-lint/issues/1795
rich>=9.5.1,<11.0.0
ansible>=2.8,<=2.9
ansible-lint>=4.2.0,<5
hacking>=2.0.0,<2.1.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"
# TODO (icey): fix zuul_swift_upload import
bash -c 'find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \
grep -v upload-swift | \
grep -v upload-charm | \
xargs -t -n1 ansible-lint'
[testenv:ansible]
allowlist_externals = bash
setenv =
ANSIBLE_LIBRARY= {toxinidir}/tests/fake-ansible
# 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:../zuul-jobs/roles:../openstack-zuul-jobs/roles:roles}
commands =
# 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"
[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:py3]
deps =
stestr
mock
requests
basepython = python3
commands = stestr run {posargs}