mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-03-26 21:43:02 +00:00
Migrate accordin to Ansible guidelines [1[]] and tool migrate.py [2] Also fixed ALL ansible-test sanity issues Add pep8 and linter job with runs ansible-test sanity test. [1] https://etherpad.openstack.org/p/openstack-ansible-modules [2] https://github.com/ansible-community/collection_migration Change-Id: Ib2b1c8f23aacfca95304132bfe5c4cdedbea0520
50 lines
1.5 KiB
INI
50 lines
1.5 KiB
INI
[tox]
|
|
minversion = 3.1
|
|
envlist = pep8
|
|
skipsdist = True
|
|
ignore_basepython_conflict = True
|
|
|
|
[testenv]
|
|
skip_install = True
|
|
install_command = pip3 install {opts} {packages}
|
|
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:linters]
|
|
passenv = *
|
|
commands =
|
|
ansible-galaxy collection build --force {toxinidir} --output-path {toxinidir}/build_artifact
|
|
ansible-galaxy collection install {toxinidir}/build_artifact/openstack-cloud-1.0.0.tar.gz --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,H236,F401,E128 are ignored so we can import the existing
|
|
# modules unchanged and then clean them in subsequent patches.
|
|
ignore = W503,H4,E501,E402,H301,H236,F401,E128,W504,F841,F403,F405
|
|
show-source = True
|
|
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
|