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.
 
 
 
 

115 lines
3.4 KiB

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