ansible-collections-openstack/tox.ini
Monty Taylor 97eb24ac4d Deal with collection build modifying tree
ansible-galaxy collection build modifies the contents of the tree.
Let's not go in to why this is bad, but instead just deal with it.
The issue in question is that is removes the +x bit from files in
the tree, which means you can't run a build twice in a row locally.
Shrug. Just roll with the -x and update our usage to reflect it.

Change-Id: I0f82531e99a98d656b60079fd3e94d4e3a1dbb6b
2020-03-05 15:08:32 +00:00

69 lines
2.0 KiB
INI

[tox]
minversion = 3.1
envlist = pep8
skipsdist = True
ignore_basepython_conflict = True
[testenv]
skip_install = True
install_command = python -m pip install {opts} {packages}
basepython = python3
passenv = OS_*
setenv =
VIRTUAL_ENV={envdir}
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_ALL=C
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
deps =
-r{toxinidir}/test-requirements.txt
commands = stestr run {posargs}
stestr slowest
[testenv:pep8]
commands =
flake8
[testenv:build]
commands =
python {toxinidir}/tools/build.py
ansible-galaxy collection build --force {toxinidir} --output-path {toxinidir}/build_artifact
[testenv:linters]
passenv = *
commands =
{[testenv:build]commands}
{[testenv:pep8]commands}
/bin/bash -c "ansible-galaxy collection install $(ls {toxinidir}/build_artifact/openstack-cloud-*) --force -p {toxinidir}"
/bin/bash -c "cd ansible_collections/openstack/cloud && ansible-test sanity"
[testenv:venv]
deps =
-r{toxinidir}/test-requirements.txt
commands = {posargs}
[flake8]
# W503 Is supposed to be off by default but in the latest pycodestyle isn't.
# Also, both openstacksdk and Donald Knuth disagree with the rule. Line
# breaks should occur before the binary operator for readability.
# H4 are rules for docstrings. Maybe we should clean them?
# E501,E402,H301 are ignored so we can import the existing
# modules unchanged and then clean them in subsequent patches.
ignore = W503,H4,E501,E402,H301
show-source = True
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build,ansible_collections
[testenv:ansible-new]
# Need to pass some env vars for the Ansible playbooks
passenv = HOME USER ANSIBLE_VAR_*
deps =
{[testenv]deps}
{toxinidir}/../os-client-config
{toxinidir}/../openstacksdk
ansible
commands =
/bin/bash {toxinidir}/ci/run-ansible-tests-collection.sh -e {envdir} {posargs}