Ansible playbooks for deploying OpenStack.
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 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. [tox]
  2. minversion = 2.0
  3. skipsdist = True
  4. envlist = linters,docs,releasenotes,inventory,py3-inventory
  5. [testenv]
  6. usedevelop = True
  7. basepython = python2.7
  8. install_command =
  9. pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
  10. deps =
  11. -r{toxinidir}/global-requirement-pins.txt
  12. -r{toxinidir}/test-requirements.txt
  13. passenv =
  14. COMMON_TESTS_PATH
  15. HOME
  16. http_proxy
  17. HTTP_PROXY
  18. https_proxy
  19. HTTPS_PROXY
  20. no_proxy
  21. NO_PROXY
  22. TESTING_BRANCH
  23. TESTING_HOME
  24. USER
  25. whitelist_externals =
  26. bash
  27. setenv =
  28. PYTHONUNBUFFERED=1
  29. PYTHONWARNINGS=default::DeprecationWarning
  30. VIRTUAL_ENV={envdir}
  31. WORKING_DIR={toxinidir}
  32. ANSIBLE_EXTRA_ROLE_DIRS={toxinidir}/playbooks/roles:{homedir}/.ansible/roles/ceph-ansible/roles
  33. ANSIBLE_ROLE_REQUIREMENTS_PATH={toxinidir}/ansible-role-requirements.yml
  34. TEST_PLAYBOOK={toxinidir}/tests/bootstrap-aio.yml {toxinidir}/playbooks/setup-everything.yml
  35. ANSIBLE_LINT_PARAMS=--exclude={homedir}/.ansible/roles
  36. [testenv:docs]
  37. basepython = python3
  38. deps = -r{toxinidir}/doc/requirements.txt
  39. commands=
  40. doc8 doc
  41. docstheme-build-translated.sh
  42. [testenv:deploy-guide]
  43. basepython = python3
  44. deps = -r{toxinidir}/doc/requirements.txt
  45. commands = sphinx-build -a -E -W -d deploy-guide/build/doctrees -b html deploy-guide/source deploy-guide/build/html
  46. [doc8]
  47. # Settings for doc8:
  48. extensions = .rst
  49. ignore = D001
  50. [testenv:releasenotes]
  51. basepython = python3
  52. deps = -r{toxinidir}/doc/requirements.txt
  53. commands =
  54. sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  55. # environment used by the -infra templated docs job
  56. [testenv:venv]
  57. basepython = python3
  58. commands =
  59. {posargs}
  60. [testenv:pep8]
  61. basepython = python3
  62. commands =
  63. bash -c "{toxinidir}/tests/common/test-pep8.sh"
  64. [flake8]
  65. # Ignores the following rules due to how ansible modules work in general
  66. # F403 'from ansible.module_utils.basic import *' used;
  67. # unable to detect undefined names
  68. ignore=F403
  69. [testenv:bashate]
  70. basepython = python3
  71. commands =
  72. bash -c "{toxinidir}/tests/common/test-bashate.sh"
  73. # The deps URL should be set to the appropriate git URL.
  74. # In the tests repo itself, the variable is uniquely set to
  75. # the toxinidir so that the role is able to test itself, but
  76. # the tox config is exactly the same as other repositories.
  77. #
  78. # The value for other repositories must be:
  79. # http://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt
  80. # or for a stable branch:
  81. # http://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt?h=stable/newton
  82. [testenv:ansible]
  83. basepython = python3
  84. deps =
  85. {[testenv]deps}
  86. -r{toxinidir}/global-requirement-pins.txt
  87. -rhttps://git.openstack.org/cgit/openstack/openstack-ansible-tests/plain/test-ansible-deps.txt
  88. [testenv:ansible-syntax]
  89. basepython = python3
  90. deps =
  91. {[testenv:ansible]deps}
  92. commands =
  93. bash -c "{toxinidir}/tests/common/test-ansible-syntax.sh"
  94. [testenv:ansible-lint]
  95. basepython = python3
  96. deps =
  97. {[testenv:ansible]deps}
  98. commands =
  99. bash -c "{toxinidir}/tests/common/test-ansible-lint.sh"
  100. [testenv:inventory]
  101. basepython = python3
  102. # Use a fixed seed since some inventory tests rely on specific ordering
  103. setenv =
  104. {[testenv]setenv}
  105. PYTHONHASHSEED = 100
  106. commands =
  107. coverage erase
  108. coverage run -a {toxinidir}/tests/test_inventory.py
  109. coverage run -a {toxinidir}/tests/test_manage.py
  110. coverage run -a {toxinidir}/tests/test_dictutils.py
  111. coverage run -a {toxinidir}/tests/test_ip.py
  112. coverage run -a {toxinidir}/tests/test_filesystem.py
  113. coverage report --show-missing --include={toxinidir}/inventory/*,{toxinidir}/osa_toolkit/*
  114. [testenv:py3-inventory]
  115. basepython = python3.5
  116. setenv =
  117. {[testenv:inventory]setenv}
  118. commands =
  119. {[testenv:inventory]commands}
  120. [testenv:linters]
  121. basepython = python3
  122. deps =
  123. {[testenv:docs]deps}
  124. {[testenv:ansible]deps}
  125. commands =
  126. {[testenv:pep8]commands}
  127. {[testenv:bashate]commands}
  128. {[testenv:ansible-lint]commands}
  129. {[testenv:ansible-syntax]commands}
  130. {[testenv:inventory]commands}
  131. {[testenv:docs]commands}