Ansible job definitions for Zuul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tox.ini 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. [tox]
  2. minversion = 1.6
  3. skipsdist = True
  4. envlist = linters
  5. [testenv]
  6. basepython = python3
  7. install_command = pip install {opts} {packages}
  8. deps = -r{toxinidir}/test-requirements.txt
  9. commands = stestr run {posargs}
  10. stestr slowest
  11. [testenv:py27]
  12. basepython = python2.7
  13. [testenv:bindep]
  14. # Do not install any requirements. We want this to be fast and work even if
  15. # system dependencies are missing, since it's used to tell you what system
  16. # dependencies are missing! This also means that bindep must be installed
  17. # separately, outside of the requirements files.
  18. deps = bindep
  19. commands = bindep test
  20. [testenv:docs]
  21. commands =
  22. sphinx-build -E -W -d doc/build/doctrees -b html doc/source/ doc/build/html
  23. [testenv:linters]
  24. passenv =
  25. # NOTE(pabelanger): if you'd like to run tox -elinters locally, you'll need
  26. # to export ANSIBLE_ROLES_PATH pointing to the currect repos.
  27. # see openstack-zuul-jobs-linters job for more information.
  28. ANSIBLE_ROLES_PATH
  29. setenv =
  30. ANSIBLE_LIBRARY= {envsitepackagesdir}/zuul/ansible/base/library
  31. ANSIBLE_ACTION_PLUGINS = {envsitepackagesdir}/zuul/ansible/base/actiongeneral
  32. whitelist_externals = bash
  33. commands =
  34. flake8 {posargs}
  35. # Ansible lint
  36. # [ANSIBLE0012] Commands should not change things if nothing needs doing
  37. bash -c "find playbooks -type f -regex '.*.ya?ml' -print0 | \
  38. xargs -t -n1 -0 ansible-lint -xANSIBLE0012"
  39. bash -c 'find roles -maxdepth 1 -mindepth 1 -type d -printf "%p/\n" | \
  40. xargs -t -n1 ansible-lint -xANSIBLE0012'
  41. # Ansible Syntax Check
  42. bash -c "find playbooks -type f -regex '.*.ya?ml' -exec \
  43. ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"
  44. {toxinidir}/tools/check_jobs_documented.py
  45. [testenv:venv]
  46. commands = {posargs}
  47. [flake8]
  48. # These are ignored intentionally in openstack-infra projects;
  49. # please don't submit patches that solely correct them or enable them.
  50. # E402 - ansible modules put documentation before imports. Align to ansible.
  51. # W504 - line break after binary operator, we cannot have both
  52. # W503 and W504 enabled
  53. ignore = E125,E129,E402,E741,W504,H
  54. show-source = True
  55. exclude = .venv,.tox,dist,doc,build,*.egg