Ansible deployment of the Kolla containers
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.

144 line
4.3KB

  1. [tox]
  2. minversion = 3.1
  3. skipsdist = True
  4. envlist = py37,linters
  5. ignore_basepython_conflict = True
  6. [testenv]
  7. basepython = python3
  8. usedevelop = True
  9. whitelist_externals = find
  10. rm
  11. deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  12. -r{toxinidir}/requirements.txt
  13. -r{toxinidir}/test-requirements.txt
  14. passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
  15. OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_LOG_CAPTURE OS_TEST_TIMEOUT
  16. PYTHON OS_TEST_PATH LISTOPT IDOPTION
  17. commands =
  18. find . -type f -name "*.py[c|o]" -delete -o -type l -name "*.py[c|o]" -delete
  19. find . -type d -name "__pycache__" -delete
  20. stestr run --slowest {posargs}
  21. [testenv:debug]
  22. commands = oslo_debug_helper -t tests {posargs}
  23. [testenv:cover]
  24. setenv = VIRTUAL_ENV={envdir}
  25. NOSE_WITH_COVERAGE=1
  26. NOSE_COVER_BRANCHES=1
  27. NOSE_COVER_HTML=1
  28. NOSE_COVER_HTML_DIR={toxinidir}/cover
  29. PYTHON=coverage run --source kolla_ansible,ansible/action_plugins,ansible/library,ansible/roles/keystone/files/ --parallel-mode
  30. commands =
  31. stestr run {posargs}
  32. coverage combine
  33. coverage html -d cover
  34. coverage xml -o cover/coverage.xml
  35. [testenv:venv]
  36. deps =
  37. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  38. -r{toxinidir}/test-requirements.txt
  39. -r{toxinidir}/doc/requirements.txt
  40. commands = {posargs}
  41. [testenv:docs]
  42. deps =
  43. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  44. -r{toxinidir}/doc/requirements.txt
  45. commands =
  46. rm -rf doc/build
  47. sphinx-build -W --keep-going -b html doc/source doc/build/html
  48. [testenv:deploy-guide]
  49. deps =
  50. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  51. -r{toxinidir}/doc/requirements.txt
  52. commands =
  53. rm -rf deploy-guide/build
  54. sphinx-build -a -E -W -d deploy-guide/build/doctrees --keep-going -b html deploy-guide/source deploy-guide/build/html
  55. [testenv:pdf-docs]
  56. whitelist_externals = make
  57. deps = {[testenv:docs]deps}
  58. commands =
  59. sphinx-build -W --keep-going -b latex doc/source doc/build/pdf
  60. make -C doc/build/pdf
  61. [testenv:releasenotes]
  62. deps =
  63. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  64. -r{toxinidir}/requirements.txt
  65. -r{toxinidir}/doc/requirements.txt
  66. commands =
  67. rm -rf releasenotes/build
  68. sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
  69. [testenv:lower-constraints]
  70. deps =
  71. -c{toxinidir}/lower-constraints.txt
  72. -r{toxinidir}/test-requirements.txt
  73. -r{toxinidir}/requirements.txt
  74. [testenv:linters]
  75. # Env vars and deps need to be defined in top level tox env
  76. setenv =
  77. ANSIBLE_LIBRARY = {toxinidir}/ansible/library
  78. ANSIBLE_ACTION_PLUGINS = {toxinidir}/ansible/action_plugins
  79. ANSIBLE_FILTER_PLUGINS = {toxinidir}/ansible/filter_plugins
  80. deps =
  81. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  82. -r{toxinidir}/test-requirements.txt
  83. -r{toxinidir}/doc/requirements.txt
  84. whitelist_externals = bash
  85. commands =
  86. {[testenv:pep8]commands}
  87. {[testenv:doc8]commands}
  88. {[testenv:bandit]commands}
  89. {[testenv:bashate]commands}
  90. {[testenv:yamllint]commands}
  91. {[testenv:ansible-lint]commands}
  92. [testenv:pep8]
  93. deps = {[testenv:linters]deps}
  94. commands =
  95. flake8 {posargs}
  96. [flake8]
  97. show-source = True
  98. # NOTE: Default ignore list is *not* empty!
  99. # W504 line break after binary operator
  100. # (W503 and W504 are incompatible and we need to choose one of them.
  101. # Existing codes follows W503, so we disable W504.):
  102. ignore = W504
  103. exclude = .eggs,.git,.tox,doc
  104. [testenv:doc8]
  105. deps = {[testenv:linters]deps}
  106. commands =
  107. doc8 doc/source
  108. doc8 -e '.yaml' releasenotes/notes/
  109. [testenv:bashate]
  110. deps = {[testenv:linters]deps}
  111. commands =
  112. bash -c "{toxinidir}/tools/run-bashate.sh"
  113. [testenv:bandit]
  114. # B303: Use of insecure MD2, MD4, MD5, or SHA1 hash function.
  115. deps = {[testenv:linters]deps}
  116. commands = bandit --skip B303 -r ansible kolla_ansible tests tools
  117. [testenv:ansible-lint]
  118. # Lint only code in ansible/* - ignore tests/ and roles/ used by CI
  119. setenv = {[testenv:linters]setenv}
  120. deps = {[testenv:linters]deps}
  121. commands =
  122. python {toxinidir}/tools/validate-all-file.py
  123. ansible-lint -p --exclude {toxinidir}/tests --exclude {toxinidir}/roles
  124. [testenv:yamllint]
  125. deps = {[testenv:linters]deps}
  126. commands = yamllint -s .