c2e8943839
Since Python 2.7 is gone EOL long time ago and C7 train is no longer maintained, so removing it. Python-3.6 is no longer works with Zed release so dropping it and switching it to zed template. From tox sanity environment, ansible-core-2.13 is getting installed. In order to override that, we need to strictly define it under tox sanity environment. Signed-off-by: Chandan Kumar (raukadah) <chkumar@redhat.com> Change-Id: Id9b01070b8d187b85b9efade4af548871b2ad369
109 lines
2.8 KiB
INI
109 lines
2.8 KiB
INI
[tox]
|
|
minversion = 3.18.0
|
|
skipsdist = True
|
|
envlist = py,pep8,packaging,sanity
|
|
requires =
|
|
tox-ansible>=1.5.3
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
setenv =
|
|
ANSIBLE_FORCE_COLOR={tty:1:0}
|
|
VIRTUAL_ENV={envdir}
|
|
passenv =
|
|
HOME
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
commands =
|
|
stestr run --slowest {posargs}
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:docs]
|
|
deps =
|
|
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
|
-r{toxinidir}/doc/requirements.txt
|
|
allowlist_externals =
|
|
rm
|
|
commands =
|
|
rm -rf doc/build
|
|
sphinx-build -W --keep-going -b html doc/source doc/build/html
|
|
|
|
[testenv:pep8]
|
|
deps = flake8
|
|
commands = flake8
|
|
|
|
[testenv:cover]
|
|
setenv =
|
|
PYTHON=coverage run --source tripleo_repos --parallel-mode
|
|
commands =
|
|
stestr run {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
|
|
[testenv:packaging]
|
|
description =
|
|
Build package, verify metadata, install package and assert basic behavior
|
|
deps =
|
|
build
|
|
twine
|
|
ansible-core # used for ansible-galaxy command
|
|
skip_install = true
|
|
commands =
|
|
# build wheel and sdist using PEP-517
|
|
{envpython} -c 'import os.path, shutil, sys; \
|
|
dist_dir = os.path.join("{toxinidir}", "dist"); \
|
|
os.path.isdir(dist_dir) or sys.exit(0); \
|
|
print("Removing \{!s\} contents...".format(dist_dir), file=sys.stderr); \
|
|
shutil.rmtree(dist_dir)'
|
|
{envpython} -m build \
|
|
--sdist \
|
|
--wheel \
|
|
--outdir {toxinidir}/dist/ \
|
|
{toxinidir}
|
|
# Validate metadata using twine
|
|
twine check {toxinidir}/dist/*
|
|
# Install the wheel
|
|
sh -c "python3 -m pip install {toxinidir}/dist/*.whl"
|
|
# Assure that CLIs were installed
|
|
tripleo-repos --help
|
|
tripleo-get-hash --help
|
|
tripleo-yum-config --help
|
|
# Validate collection installation
|
|
ansible-galaxy collection install --force .
|
|
# Ensure that ansible is able to load the modules, as syntax check will fail
|
|
# if modules cannot be loaded.
|
|
sh -c "ansible-playbook --syntax-check playbooks/*.yaml"
|
|
ansible localhost -m tripleo.repos.get_hash -a "release=master os_version=centos8"
|
|
|
|
allowlist_externals =
|
|
sh
|
|
|
|
# https://github.com/ansible-community/tox-ansible/issues/96
|
|
# Override ansible version coming from ansible-test package.
|
|
[testenv:sanity]
|
|
deps =
|
|
ansible-core>=2.11,<2.12
|
|
|
|
[testenv:molecule]
|
|
description = Used by all molecule jobs (tox-ansible)
|
|
deps =
|
|
ansible-core
|
|
molecule>=3.3.0,<3.4.0 # bug with collection install
|
|
molecule-docker
|
|
usedevelop = False
|
|
skip_install = true
|
|
commands =
|
|
ansible-galaxy collection install -v 'community.docker:>=1.8.0'
|
|
ansible-galaxy collection install -v --force .
|
|
molecule test
|
|
|
|
[flake8]
|
|
ignore = H803
|
|
show-source = True
|
|
exclude = .tox,dist,doc,*.egg,build
|