forked from rcbops/rpc-openstack
/
tox.ini
69 lines (58 loc) · 2.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
[tox]
minversion = 2.0
skipsdist = True
envlist = flake8,ansible-lint,bashate,docs,releasenotes,release-script
toxworkdir={env:TOX_WORK_DIR:.tox}
[testenv]
passenv = ANSIBLE_VERSION
basepython = python2.7
whitelist_externals =
bash
sed
deps =
-rtest-requirements.txt
ansible{env:ANSIBLE_VERSION:==2.2.2}
-e./hacking
setenv =
ANSIBLE_ACTION_PLUGINS = {homedir}/.ansible/roles/plugins/action
ANSIBLE_CALLBACK_PLUGINS = {homedir}/.ansible/roles/plugins/callback
ANSIBLE_FILTER_PLUGINS = {homedir}/.ansible/roles/plugins/filter
ANSIBLE_LOOKUP_PLUGINS = {homedir}/.ansible/roles/plugins/lookup
ANSIBLE_LIBRARY = {homedir}/.ansible/roles/plugins/library:{toxinidir}/rpcd/playbooks/library
ANSIBLE_ROLES_PATH = {homedir}/.ansible/roles:{toxinidir}/rpcd/playbooks/roles:{toxinidir}/openstack-ansible/playbooks/roles
[testenv:releasenotes]
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:docs]
commands=
python setup.py build_sphinx
# environment used by the -infra templated docs job
[testenv:venv]
deps = -r{toxinidir}/test-requirements.txt
commands = {posargs}
[testenv:flake8]
commands =
{toxinidir}/scripts/linting-pep8.sh
[testenv:bashate]
commands =
{toxinidir}/scripts/linting-bashate.sh
[testenv:ansible-lint]
commands =
bash -c 'source {toxinidir}/scripts/functions.sh; \
test -d {toxinidir}/openstack-ansible || git clone https://git.openstack.org/openstack/openstack-ansible {toxinidir}/openstack-ansible; \
pushd {toxinidir}/openstack-ansible; \
git checkout "$OSA_RELEASE"; \
popd; \
sed "/etc\/ansible/d" {toxinidir}/openstack-ansible/ansible-role-requirements.yml | tee -a {homedir}/openstack-ansible-role-requirements.yml; \
ansible-galaxy install -r {toxinidir}/ansible-role-requirements.yml; \
ansible-galaxy install -r {homedir}/openstack-ansible-role-requirements.yml; \
{toxinidir}/scripts/linting-ansible.sh'
[testenv:release-script]
commands = python -m unittest discover -s scripts -p test_release.py -v
[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
# H303 No wildcard (*) import.
# R excludes all of the RPC specific checks
# Excluding our vendored f5 configuration script.
ignore=F403,H303,R
exclude=openstack-ansible/*,f5-config.py