Deployment of containerised OpenStack to bare metal using kolla and bifrost
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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. [tox]
  2. minversion = 2.0
  3. envlist = py35,py27,pep8
  4. skipsdist = True
  5. [testenv]
  6. usedevelop = True
  7. install_command = pip install {opts} {packages}
  8. passenv =
  9. HOME
  10. whitelist_externals =
  11. bash
  12. rm
  13. setenv =
  14. VIRTUAL_ENV={envdir}
  15. PYTHONWARNINGS=default::DeprecationWarning
  16. OS_STDOUT_CAPTURE=1
  17. OS_STDERR_CAPTURE=1
  18. OS_TEST_TIMEOUT=60
  19. deps =
  20. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  21. -r{toxinidir}/requirements.txt
  22. -r{toxinidir}/test-requirements.txt
  23. commands = stestr run {posargs}
  24. [testenv:pep8]
  25. basepython = python3
  26. commands =
  27. {toxinidir}/tools/run-bashate.sh
  28. flake8 {posargs} kayobe
  29. # Check the *.rst files
  30. # We use a thin wrapper around doc8 currently, which has support for sphinx
  31. # directives.
  32. {toxinidir}/tools/sphinx8 README.rst CONTRIBUTING.rst doc/source --ignore D001
  33. yamllint etc/kayobe
  34. [testenv:venv]
  35. basepython = python3
  36. deps =
  37. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  38. -r{toxinidir}/test-requirements.txt
  39. -r{toxinidir}/doc/requirements.txt
  40. commands = {posargs}
  41. [testenv:ansible]
  42. # Kolla currently fails during password generation under python3. Revisit in Rocky.
  43. basepython = python2
  44. usedevelop = True
  45. # Create the virtualenv with access to system site packages, as this is
  46. # required to use the python and apt modules, which are not available via PyPI.
  47. sitepackages = True
  48. commands =
  49. # Install ansible role dependencies from Galaxy.
  50. ansible-galaxy install \
  51. -r {toxinidir}/requirements.yml \
  52. -p {toxinidir}/ansible/roles
  53. {toxinidir}/tools/test-ansible.sh {posargs}
  54. [testenv:molecule]
  55. # Molecule only supports python 2.7 and 3.6.
  56. basepython = python2
  57. deps =
  58. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  59. -r{toxinidir}/test-requirements.txt
  60. -r{toxinidir}/doc/requirements.txt
  61. whitelist_externals =
  62. bash
  63. commands =
  64. # Install ansible role dependencies from Galaxy.
  65. ansible-galaxy install \
  66. -r {toxinidir}/requirements.yml \
  67. -p {toxinidir}/ansible/roles
  68. bash -c "source {envdir}/bin/activate && {toxinidir}/tools/test-molecule.sh {posargs}"
  69. [testenv:alint]
  70. basepython = python3
  71. commands = ansible-lint ansible/*.yaml
  72. [testenv:ansible-syntax]
  73. basepython = python3
  74. commands =
  75. # Install ansible role dependencies from Galaxy.
  76. ansible-galaxy install \
  77. -r {toxinidir}/requirements.yml \
  78. -p {toxinidir}/ansible/roles
  79. # Perform an Ansible syntax check. Skip some playbooks which require extra
  80. # variables to be defined.
  81. bash -c \
  82. "ansible-playbook \
  83. --connection=local \
  84. --syntax-check \
  85. --list-tasks \
  86. $(find {toxinidir}/ansible \
  87. -maxdepth 1 \
  88. -name '*.yml' \
  89. -not -name idrac-bootstrap-one.yml \
  90. -not -name idrac-bootstrap.yml) \
  91. {posargs}"
  92. [testenv:cover]
  93. basepython = python3
  94. setenv =
  95. VIRTUAL_ENV={envdir}
  96. PYTHON=coverage run --source kayobe --parallel-mode
  97. commands =
  98. coverage erase
  99. stestr run {posargs}
  100. coverage combine
  101. coverage report
  102. coverage html -d cover
  103. coverage xml -o cover/coverage.xml
  104. [testenv:docs]
  105. basepython = python3
  106. deps =
  107. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  108. -r{toxinidir}/requirements.txt
  109. -r{toxinidir}/doc/requirements.txt
  110. commands = sphinx-build -W -b html doc/source doc/build/html
  111. [testenv:debug]
  112. basepython = python3
  113. commands = oslo_debug_helper {posargs}
  114. [testenv:releasenotes]
  115. basepython = python3
  116. deps =
  117. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  118. -r{toxinidir}/requirements.txt
  119. -r{toxinidir}/doc/requirements.txt
  120. commands =
  121. rm -rf releasenotes/build
  122. sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  123. [flake8]
  124. # E123, E125 skipped as they are invalid PEP-8.
  125. show-source = True
  126. ignore = E123,E125
  127. builtins = _
  128. exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build