![Andreas Jaeger](/assets/img/avatar_default.png)
Install zuul so that ansible-lint has zuul integration and will not fail some tests. for this, move all requirements directly into tox.ini so that not every job needs to install them. Change-Id: I2b16600fad4c18f790e842b200ae21fd90051077
116 lines
3.3 KiB
INI
116 lines
3.3 KiB
INI
[tox]
|
|
minversion = 1.6
|
|
envlist = linters,gerrit,grafyaml
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
|
|
|
|
[testenv:linters]
|
|
commands =
|
|
{toxinidir}/tools/run-bashate.sh
|
|
flake8
|
|
# Check that zuul.d/projects.yaml list is sorted
|
|
{toxinidir}/tools/zuul-projects_sorted.sh
|
|
|
|
[testenv:ansible-linters]
|
|
# TODO(jaegerandi): merge this in linters job once it works fine
|
|
# zuul needs python3
|
|
basepython = python3
|
|
deps =
|
|
# Zuul is required to supply the zuul ansible modules for ansible-lint
|
|
-egit+https://git.openstack.org/openstack-infra/zuul@feature/zuulv3#egg=zuul
|
|
ansible<2.4.0
|
|
ansible-lint
|
|
whitelist_externals = bash
|
|
setenv =
|
|
ANSIBLE_LIBRARY= {envdir}/src/zuul/zuul/ansible/library
|
|
passenv =
|
|
# NOTE(pabelanger): if you'd like to run tox -elinters locally, you'll need
|
|
# to export ANSIBLE_ROLES_PATH pointing to the currect repos.
|
|
# see infra-zuul-jobs-linters job for more information.
|
|
ANSIBLE_ROLES_PATH
|
|
commands =
|
|
# Ansible lint
|
|
# [ANSIBLE0012] Commands should not change things if nothing needs doing
|
|
bash -c "find playbooks -type d -name "legacy" -prune -o \
|
|
-type f -regex '.*.y[a]ml' -print0 | xargs -t -n1 -0 \
|
|
ansible-lint -xANSIBLE0012"
|
|
# Ansible Syntax Check
|
|
bash -c "cd playbooks; find . -type f -regex '.*.y[a]?ml' -exec \
|
|
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"
|
|
|
|
[testenv:gerrit]
|
|
deps = PyYAML
|
|
GitPython
|
|
commands =
|
|
{toxinidir}/tools/check_valid_gerrit_projects.py gerrit/projects.yaml gerrit/acls
|
|
{toxinidir}/tools/check_projects_yaml_alphabetized.sh gerrit/projects.yaml
|
|
{toxinidir}/tools/check_valid_gerrit_config.sh gerrit/acls/
|
|
{toxinidir}/tools/check_gerrit_projects_changed.sh
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:docs]
|
|
commands = python setup.py build_sphinx
|
|
|
|
[testenv:irc]
|
|
deps = PyYAML
|
|
irc
|
|
commands =
|
|
{toxinidir}/tools/check_irc_access.py -l accessbot/channels.yaml openstackinfra
|
|
{toxinidir}/tools/irc_tests.py
|
|
{toxinidir}/tools/check-channels-yaml.sh
|
|
|
|
[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:grafyaml]
|
|
basepython = python2.7
|
|
commands = {toxinidir}/tools/grafyaml-validate.sh
|
|
|
|
[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]
|
|
deps =
|
|
Jinja2
|
|
PyYAML
|
|
commands = {toxinidir}/docs-site/generate_infra_index.py {toxinidir}/docs-site/infra-documents.yaml
|
|
|
|
[testenv:specs]
|
|
deps =
|
|
Jinja2
|
|
PyYAML
|
|
commands = {toxinidir}/specs/generate_specs_site.py {toxinidir}/specs/specs.yaml
|
|
|
|
[testenv:dib]
|
|
deps =
|
|
diskimage-builder
|
|
changedir = {toxinidir}/nodepool
|
|
commands = env ELEMENTS_DIR=elements dib-lint
|
|
|
|
[testenv:nodepool]
|
|
commands = nodepool -c {toxinidir}/nodepool/nodepool.yaml config-validate
|
|
|
|
[testenv:add-projects-to-main]
|
|
basepython = python3
|
|
whitelist_externals =
|
|
git
|
|
deps =
|
|
ruamel.yaml
|
|
commands =
|
|
python tools/add-projects-to-main.py
|
|
git diff-files --quiet
|