A service for managing and provisioning Bare Metal servers.
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.
 
 
 
 

167 lines
5.5 KiB

  1. [tox]
  2. minversion = 3.2.1
  3. skipsdist = True
  4. envlist = py3,pep8
  5. ignore_basepython_conflict=true
  6. [testenv]
  7. usedevelop = True
  8. basepython = python3
  9. setenv = VIRTUAL_ENV={envdir}
  10. PYTHONDONTWRITEBYTECODE = 1
  11. LANGUAGE=en_US
  12. LC_ALL=en_US.UTF-8
  13. PYTHONWARNINGS=default::DeprecationWarning
  14. TESTS_DIR=./ironic/tests/unit/
  15. deps =
  16. -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  17. -r{toxinidir}/requirements.txt
  18. -r{toxinidir}/test-requirements.txt
  19. commands =
  20. stestr run {posargs}
  21. passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
  22. [testenv:unit-with-driver-libs]
  23. deps = {[testenv]deps}
  24. -r{toxinidir}/driver-requirements.txt
  25. [testenv:genstates]
  26. deps = {[testenv]deps}
  27. pydot2
  28. commands = {toxinidir}/tools/states_to_dot.py -f {toxinidir}/doc/source/images/states.svg --format svg
  29. [testenv:pep8]
  30. usedevelop = False
  31. deps=
  32. hacking>=3.1.0,<4.0.0 # Apache-2.0
  33. doc8>=0.6.0 # Apache-2.0
  34. pycodestyle>=2.0.0,<2.7.0 # MIT
  35. flake8-import-order>=0.17.1 # LGPLv3
  36. Pygments>=2.2.0 # BSD
  37. bashate>=0.5.1 # Apache-2.0
  38. whitelist_externals = bash
  39. commands =
  40. bash tools/flake8wrap.sh {posargs}
  41. # Run bashate during pep8 runs to ensure violations are caught by
  42. # the check and gate queues.
  43. {toxinidir}/tools/run_bashate.sh {toxinidir}
  44. # Check the *.rst files
  45. doc8 README.rst CONTRIBUTING.rst doc/source --ignore D001
  46. # Check to make sure reno releasenotes created with 'reno new'
  47. {toxinidir}/tools/check-releasenotes.py
  48. [testenv:cover]
  49. setenv = VIRTUAL_ENV={envdir}
  50. LANGUAGE=en_US
  51. PYTHON=coverage run --source ironic --omit='*tests*' --parallel-mode
  52. commands =
  53. coverage erase
  54. stestr run {posargs}
  55. coverage combine
  56. coverage report --omit='*tests*'
  57. coverage html -d ./cover --omit='*tests*'
  58. [testenv:genconfig]
  59. sitepackages = False
  60. envdir = {toxworkdir}/venv
  61. commands =
  62. oslo-config-generator --config-file=tools/config/ironic-config-generator.conf
  63. [testenv:genpolicy]
  64. sitepackages = False
  65. envdir = {toxworkdir}/venv
  66. commands =
  67. oslopolicy-sample-generator --config-file=tools/policy/ironic-policy-generator.conf
  68. [testenv:debug]
  69. commands = oslo_debug_helper -t ironic/tests/unit {posargs}
  70. [testenv:docs]
  71. # NOTE(dtantsur): documentation building process requires importing ironic
  72. deps =
  73. -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  74. -r{toxinidir}/requirements.txt
  75. -r{toxinidir}/doc/requirements.txt
  76. commands = sphinx-build -b html -W doc/source doc/build/html
  77. [testenv:pdf-docs]
  78. whitelist_externals = make
  79. deps = {[testenv:docs]deps}
  80. commands =
  81. sphinx-build -W -b latex doc/source doc/build/pdf
  82. make -C doc/build/pdf
  83. [testenv:api-ref]
  84. usedevelop = False
  85. deps =
  86. -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  87. -r{toxinidir}/doc/requirements.txt
  88. whitelist_externals = bash
  89. commands =
  90. bash -c 'rm -rf api-ref/build'
  91. sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
  92. [testenv:releasenotes]
  93. usedevelop = False
  94. deps =
  95. -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  96. -r{toxinidir}/doc/requirements.txt
  97. commands =
  98. sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  99. [testenv:venv]
  100. setenv = PYTHONHASHSEED=0
  101. deps =
  102. -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  103. -r{toxinidir}/test-requirements.txt
  104. -r{toxinidir}/doc/requirements.txt
  105. commands = {posargs}
  106. [flake8]
  107. # [E129] visually indented line with same indent as next logical line
  108. # [E741] ambiguous variable name
  109. # [W503] Line break before binary operator.
  110. ignore = E129,E741,W503
  111. filename = *.py,app.wsgi
  112. exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
  113. import-order-style = pep8
  114. application-import-names = ironic
  115. max-complexity=18
  116. # [H106] Don't put vim configuration in source files.
  117. # [H203] Use assertIs(Not)None to check for None.
  118. # [H204] Use assert(Not)Equal to check for equality.
  119. # [H205] Use assert(Greater|Less)(Equal) for comparison.
  120. # [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls
  121. # [H904] Delay string interpolations at logging calls.
  122. enable-extensions=H106,H203,H204,H205,H210,H904
  123. # TODO(rpittau) remove the ignores below when we're ready to apply H210 to
  124. # the various modules. This can be done in batches changing the filters.
  125. per-file-ignores =
  126. ironic/cmd/__init__.py:E402
  127. ironic/tests/base.py:E402
  128. ironic/tests/unit/api/controllers/v1/test_volume_target.py:H210
  129. ironic/tests/unit/api/controllers/v1/test_volume_connector.py:H210
  130. ironic/tests/unit/api/controllers/v1/test_driver.py:H210
  131. ironic/tests/unit/api/controllers/v1/test_portgroup.py:H210
  132. ironic/tests/unit/api/controllers/v1/test_chassis.py:H210
  133. ironic/tests/unit/api/controllers/v1/test_node.py:H210
  134. ironic/tests/unit/api/controllers/v1/test_types.py:H210
  135. ironic/tests/unit/api/controllers/v1/test_notification_utils.py:H210
  136. ironic/tests/unit/api/controllers/v1/test_port.py:H210
  137. ironic/tests/unit/drivers/modules/test_console_utils.py:H210
  138. [hacking]
  139. import_exceptions = testtools.matchers, ironic.common.i18n
  140. [flake8:local-plugins]
  141. # [N323] Found use of _() without explicit import of _!
  142. extension =
  143. N323 = checks:check_explicit_underscore_import
  144. paths = ./ironic/hacking/
  145. [testenv:bandit]
  146. usedevelop = False
  147. deps = -r{toxinidir}/test-requirements.txt
  148. commands = bandit -r ironic -x tests -n5 -ll -c tools/bandit.yml