b58a2c0287
In order to be able to simultaneously work with the differing implementations of zuul-cloner in zuul v2 and zuul v3 we implement a detection routine to behave appropriately for each version. This is very much a band-aid just to help us transition because once the transition to zuul v3 is complete we should be able to ditch this whole playbook for something built into zuul v3, and use something very simple for executing tests when not using zuul. Change-Id: Ic824e7ca7c564d5de7a27c77a79014ad274afade
136 lines
3.3 KiB
INI
136 lines
3.3 KiB
INI
[tox]
|
|
minversion = 2.0
|
|
skipsdist = True
|
|
envlist = docs,linters,func
|
|
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command =
|
|
pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
|
deps =
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands =
|
|
/usr/bin/find . -type f -name "*.pyc" -delete
|
|
passenv =
|
|
HOME
|
|
http_proxy
|
|
HTTP_PROXY
|
|
https_proxy
|
|
HTTPS_PROXY
|
|
no_proxy
|
|
NO_PROXY
|
|
whitelist_externals =
|
|
bash
|
|
setenv =
|
|
PYTHONUNBUFFERED=1
|
|
VIRTUAL_ENV={envdir}
|
|
WORKING_DIR={toxinidir}
|
|
|
|
|
|
[testenv:docs]
|
|
commands=
|
|
bash -c "rm -rf doc/build"
|
|
doc8 doc
|
|
python setup.py build_sphinx
|
|
|
|
|
|
[doc8]
|
|
# Settings for doc8:
|
|
extensions = .rst
|
|
|
|
|
|
[testenv:releasenotes]
|
|
commands =
|
|
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
|
|
# environment used by the -infra templated docs job
|
|
[testenv:venv]
|
|
commands =
|
|
{posargs}
|
|
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
|
|
bash -c "{toxinidir}/tests/common/test-pep8.sh"
|
|
|
|
|
|
[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
|
|
ignore=F403
|
|
|
|
|
|
[testenv:bashate]
|
|
commands =
|
|
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
|
|
bash -c "{toxinidir}/tests/common/test-bashate.sh"
|
|
|
|
|
|
# The deps URL should be set to the appropriate git URL.
|
|
# In the tests repo itself, the variable is uniquely set to
|
|
# the toxinidir so that the role is able to test itself, but
|
|
# the tox config is exactly the same as other repositories.
|
|
#
|
|
# The value for other repositories must be:
|
|
# http://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt
|
|
# or for a stable branch:
|
|
# http://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt?h=stable/newton
|
|
[testenv:ansible]
|
|
deps =
|
|
{[testenv]deps}
|
|
-rhttps://git.openstack.org/cgit/openstack/openstack-ansible/plain/global-requirement-pins.txt
|
|
-r{toxinidir}/test-ansible-deps.txt
|
|
|
|
|
|
[testenv:ansible-syntax]
|
|
deps =
|
|
{[testenv:ansible]deps}
|
|
commands =
|
|
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
|
|
bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh"
|
|
|
|
|
|
[testenv:ansible-lint]
|
|
deps =
|
|
{[testenv:ansible]deps}
|
|
commands =
|
|
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
|
|
bash -c "{toxinidir}/tests/common/test-ansible-lint.sh"
|
|
|
|
|
|
# This is here due to a bug in the ubuntu-xenial
|
|
# job which does not do the translation from
|
|
# 'func' to 'functional' for us.
|
|
# TODO(odyssey4me):
|
|
# Remove this once https://review.openstack.org/512351
|
|
# has been merged.
|
|
[testenv:func]
|
|
deps =
|
|
{[testenv:ansible]deps}
|
|
commands =
|
|
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
|
|
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
|
|
|
|
|
|
[testenv:functional]
|
|
deps =
|
|
{[testenv:ansible]deps}
|
|
commands =
|
|
bash -c "{toxinidir}/tests/tests-repo-clone.sh"
|
|
bash -c "{toxinidir}/tests/common/test-ansible-functional.sh"
|
|
|
|
|
|
[testenv:linters]
|
|
deps =
|
|
{[testenv:ansible]deps}
|
|
commands =
|
|
{[testenv:pep8]commands}
|
|
{[testenv:bashate]commands}
|
|
{[testenv:ansible-lint]commands}
|
|
{[testenv:ansible-syntax]commands}
|
|
{[testenv:docs]commands}
|