OpenStack Orchestration (Heat)
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.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. [tox]
  2. envlist = py36,py35,py27,pep8
  3. minversion = 1.6
  4. skipsdist = True
  5. [testenv]
  6. setenv = VIRTUAL_ENV={envdir}
  7. PYTHONWARNINGS=default::DeprecationWarning
  8. OS_TEST_PATH=heat/tests
  9. usedevelop = True
  10. install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
  11. deps = -r{toxinidir}/requirements.txt
  12. -r{toxinidir}/test-requirements.txt
  13. commands =
  14. find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
  15. stestr run {posargs}
  16. stestr slowest
  17. whitelist_externals =
  18. bash
  19. find
  20. passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
  21. [testenv:py27log]
  22. commands =
  23. find {toxinidir} -type f -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
  24. stestr run '^(?!heat_integrationtests){posargs}'
  25. [testenv:pep8]
  26. basepython = python3
  27. commands =
  28. flake8 heat bin/heat-api bin/heat-api-cfn bin/heat-engine bin/heat-manage contrib heat_integrationtests doc/source
  29. python tools/custom_guidelines.py --exclude heat/engine/resources/aws
  30. # The following bandit tests are being skipped:
  31. # B101: Test for use of assert
  32. # B104: Test for binding to all interfaces
  33. # B107: Test for use of hard-coded password argument defaults
  34. # B110: Try, Except, Pass detected.
  35. # B310: Audit url open for permitted schemes
  36. # B311: Standard pseudo-random generators are not suitable for security/cryptographic purposes
  37. # B404: Import of subprocess module
  38. # B410: Import of lxml module
  39. # B504: Test for SSL use with no version specified
  40. # B506: Test for use of yaml load
  41. # B603: Test for use of subprocess with shell equals true
  42. # B607: Test for starting a process with a partial path
  43. bandit -r heat -x tests --skip B101,B104,B107,B110,B310,B311,B404,B410,B504,B506,B603,B607
  44. doc8 {posargs}
  45. [testenv:venv]
  46. basepython = python3
  47. commands = {posargs}
  48. [testenv:cover]
  49. basepython = python3
  50. setenv =
  51. PYTHON=coverage run --source heat --parallel-mode
  52. commands =
  53. coverage erase
  54. find {toxinidir} -not -path '{toxinidir}/.tox/*' -not -path '*/__pycache__/*' -name '*.py[c|o]' -delete
  55. stestr run {posargs}
  56. coverage combine
  57. coverage html -d cover
  58. coverage xml -o cover/coverage.xml
  59. coverage report
  60. [testenv:docs]
  61. basepython = python3
  62. deps = -r{toxinidir}/doc/requirements.txt
  63. commands =
  64. rm -rf doc/build
  65. sphinx-build -W -b html doc/source doc/build/html
  66. [testenv:api-ref]
  67. basepython = python3
  68. # This environment is called from CI scripts to test and publish
  69. # the API Ref to developer.openstack.org.
  70. deps = -r{toxinidir}/doc/requirements.txt
  71. whitelist_externals = bash
  72. rm
  73. commands =
  74. rm -rf api-ref/build
  75. sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
  76. [testenv:genconfig]
  77. basepython = python3
  78. commands =
  79. oslo-config-generator --config-file=config-generator.conf
  80. oslo-config-generator --config-file=heat_integrationtests/config-generator.conf
  81. [testenv:genpolicy]
  82. basepython = python3
  83. commands =
  84. oslopolicy-sample-generator --config-file etc/heat/heat-policy-generator.conf
  85. [testenv:bandit]
  86. basepython = python3
  87. deps = -r{toxinidir}/test-requirements.txt
  88. # The following bandit tests are being skipped:
  89. # B101: Test for use of assert
  90. # B104: Test for binding to all interfaces
  91. # B107: Test for use of hard-coded password argument defaults
  92. # B110: Try, Except, Pass detected.
  93. # B310: Audit url open for permitted schemes
  94. # B311: Standard pseudo-random generators are not suitable for security/cryptographic purposes
  95. # B404: Import of subprocess module
  96. # B410: Import of lxml module
  97. # B504: Test for SSL use with no version specified
  98. # B506: Test for use of yaml load
  99. # B603: Test for use of subprocess with shell equals true
  100. # B607: Test for starting a process with a partial path
  101. commands = bandit -r heat -x tests --skip B101,B104,B107,B110,B310,B311,B404,B410,B504,B506,B603,B607
  102. [flake8]
  103. show-source = true
  104. exclude=.*,dist,*lib/python*,*egg,build,*convergence/scenarios/*
  105. max-complexity=20
  106. [doc8]
  107. ignore = D001
  108. ignore-path = .venv,.git,.tox,.tmp,*heat/locale*,*lib/python*,openstack_heat.egg*,doc/build,releasenotes/*
  109. [hacking]
  110. import_exceptions = heat.common.i18n
  111. local-check-factory = heat.hacking.checks.factory
  112. [testenv:debug]
  113. basepython = python3
  114. commands = oslo_debug_helper {posargs}
  115. [testenv:releasenotes]
  116. basepython = python3
  117. deps = -r{toxinidir}/doc/requirements.txt
  118. commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  119. [testenv:lower-constraints]
  120. basepython = python3
  121. install_command = pip install {opts} {packages}
  122. deps =
  123. -c{toxinidir}/lower-constraints.txt
  124. -r{toxinidir}/test-requirements.txt
  125. -r{toxinidir}/requirements.txt