dbc1f26848
For compliance with the Project Testing Interface [1] as described in [2]. [1] https://governance.openstack.org/tc/reference/project-testing-interface.html [2] http://lists.openstack.org/pipermail/openstack-dev/2017-December/125710.html Change-Id: I03d36b2545f69c4ca3ca1ced73d179e81b7b8811
109 lines
3.0 KiB
INI
109 lines
3.0 KiB
INI
[tox]
|
|
minversion = 2.0
|
|
envlist = py35,py27,pep8
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command = pip install {opts} {packages}
|
|
passenv =
|
|
HOME
|
|
whitelist_externals =
|
|
bash
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
PYTHONWARNINGS=default::DeprecationWarning
|
|
OS_STDOUT_CAPTURE=1
|
|
OS_STDERR_CAPTURE=1
|
|
OS_TEST_TIMEOUT=60
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands = stestr run {posargs}
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
{toxinidir}/tools/run-bashate.sh
|
|
flake8 {posargs} kayobe
|
|
# Check the *.rst files
|
|
# We use a thin wrapper around doc8 currently, which has support for sphinx
|
|
# directives.
|
|
{toxinidir}/tools/sphinx8 README.rst CONTRIBUTING.rst doc/source --ignore D001
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:ansible]
|
|
usedevelop = True
|
|
# Create the virtualenv with access to system site packages, as this is
|
|
# required to use the python and apt modules, which are not available via PyPI.
|
|
sitepackages = True
|
|
commands =
|
|
# Install ansible role dependencies from Galaxy.
|
|
ansible-galaxy install \
|
|
-r {toxinidir}/requirements.yml \
|
|
-p {toxinidir}/ansible/roles
|
|
{toxinidir}/tools/test-ansible.sh {posargs}
|
|
|
|
[testenv:molecule]
|
|
commands =
|
|
# Install ansible role dependencies from Galaxy.
|
|
ansible-galaxy install \
|
|
-r {toxinidir}/requirements.yml \
|
|
-p {toxinidir}/ansible/roles
|
|
{toxinidir}/tools/test-molecule.sh {posargs}
|
|
|
|
[testenv:alint]
|
|
commands = ansible-lint ansible/*.yaml
|
|
|
|
[testenv:ansible-syntax]
|
|
commands =
|
|
# Install ansible role dependencies from Galaxy.
|
|
ansible-galaxy install \
|
|
-r {toxinidir}/requirements.yml \
|
|
-p {toxinidir}/ansible/roles
|
|
# Perform an Ansible syntax check. Skip some playbooks which require extra
|
|
# variables to be defined.
|
|
bash -c \
|
|
"ansible-playbook \
|
|
--connection=local \
|
|
--syntax-check \
|
|
--list-tasks \
|
|
$(find {toxinidir}/ansible \
|
|
-maxdepth 1 \
|
|
-name '*.yml' \
|
|
-not -name idrac-bootstrap-one.yml \
|
|
-not -name idrac-bootstrap.yml) \
|
|
{posargs}"
|
|
|
|
[testenv:cover]
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
PYTHON=coverage run --source kayobe --parallel-mode
|
|
commands =
|
|
coverage erase
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage report
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
[testenv:docs]
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/pike}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/doc/requirements.txt
|
|
commands = sphinx-build -b html doc/source doc/build/html
|
|
|
|
[testenv:debug]
|
|
commands = oslo_debug_helper {posargs}
|
|
|
|
[flake8]
|
|
# E123, E125 skipped as they are invalid PEP-8.
|
|
|
|
show-source = True
|
|
ignore = E123,E125
|
|
builtins = _
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|