Heat templates 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.

125 lines
3.6KB

  1. [tox]
  2. minversion = 2.0
  3. skipsdist = True
  4. envlist = pep8,py27,py37,tht
  5. [testenv]
  6. usedevelop = True
  7. deps =
  8. -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
  9. -r{toxinidir}/requirements.txt
  10. -r{toxinidir}/test-requirements.txt
  11. commands = python setup.py testr --slowest --testr-args='{posargs}'
  12. [testenv:venv]
  13. basepython = python3
  14. commands = {posargs}
  15. [testenv:pep8]
  16. basepython = python3
  17. whitelist_externals =
  18. bash
  19. commands =
  20. python ./tools/process-templates.py
  21. python ./network/endpoints/build_endpoint_map.py --check
  22. python ./tools/yaml-validate.py .
  23. bash -c ./tools/roles-data-validation.sh
  24. bash -c ./tools/check-up-to-date.sh
  25. flake8 --exclude releasenotes --ignore {[testenv:flake8]ignore}
  26. [testenv:flake8]
  27. basepython = python3
  28. # E125 is deliberately excluded. See
  29. # https://github.com/jcrocholl/pep8/issues/126. It's just wrong.
  30. #
  31. # Most of the whitespace related rules (E12* and E131) are excluded
  32. # because while they are often useful guidelines, strict adherence to
  33. # them ends up causing some really odd code formatting and forced
  34. # extra line breaks. Updating code to enforce these will be a hard sell.
  35. #
  36. # H405 is another one that is good as a guideline, but sometimes
  37. # multiline doc strings just don't have a natural summary
  38. # line. Rejecting code for this reason is wrong.
  39. #
  40. # E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301
  41. #
  42. # The following two are also ignored that we don't think it is useful.
  43. # W503 line break before binary operator
  44. # W504 line break after binary operator
  45. #
  46. # The following rules are currently ignored, but will be enforced
  47. # in the future
  48. # E501 line too long
  49. # E731 do not assign a lambda expression, use a def
  50. # W605 invalid escape sequence
  51. ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405,W503,W504,E501,E731,W605
  52. exclude = releasenotes
  53. [testenv:templates]
  54. basepython = python3
  55. commands = python ./tools/process-templates.py
  56. [testenv:clean]
  57. basepython = python3
  58. commands = python ./tools/process-templates.py -c
  59. [testenv:releasenotes]
  60. basepython = python3
  61. whitelist_externals =
  62. bash
  63. commands = bash -c tools/releasenotes_tox.sh
  64. [testenv:cover]
  65. basepython = python3
  66. commands = python setup.py test --coverage --coverage-package-name=tripleo_heat_templates --testr-args='{posargs}'
  67. [testenv:genconfig]
  68. basepython = python3
  69. commands =
  70. python ./tools/process-templates.py
  71. python ./tripleo_heat_templates/environment_generator.py sample-env-generator/
  72. [testenv:genroledata]
  73. basepython = python3
  74. whitelist_externals =
  75. bash
  76. commands =
  77. bash -c tools/roles-data-generate-samples.sh
  78. [testenv:lower-constraints]
  79. basepython = python3
  80. deps =
  81. -c{toxinidir}/lower-constraints.txt
  82. -r{toxinidir}/test-requirements.txt
  83. -r{toxinidir}/requirements.txt
  84. [testenv:tht]
  85. basepython = python3
  86. usedevelop = True
  87. setenv =
  88. ANSIBLE_FORCE_COLOR=1
  89. ANSIBLE_INVENTORY={toxinidir}/test/hosts.ini
  90. ANSIBLE_THT_FOLDER={toxinidir}
  91. ANSIBLE_NOCOWS=1
  92. ANSIBLE_RETRY_FILES_ENABLED=0
  93. ANSIBLE_STDOUT_CALLBACK=debug
  94. PY_COLORS=1
  95. VIRTUAL_ENV={envdir}
  96. # Avoid 2020-01-01 warnings: https://github.com/pypa/pip/issues/6207
  97. PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
  98. PIP_DISABLE_PIP_VERSION_CHECK=1
  99. passenv =
  100. ANSIBLE_*
  101. deps =
  102. -r{toxinidir}/test-ansible-requirements.txt
  103. whitelist_externals =
  104. bash
  105. commands_pre =
  106. pip install -q bindep
  107. bindep test
  108. commands =
  109. pytest --color=no \
  110. --html={envlogdir}/reports.html \
  111. --self-contained-html \
  112. {toxinidir}/tripleo_heat_templates/tests/test_tht_ansible_syntax.py