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.
 
 
 
 

152 lines
4.7 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:UPPER_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. whitelist_externals = bash
  31. commands =
  32. bash tools/flake8wrap.sh {posargs}
  33. # Run bashate during pep8 runs to ensure violations are caught by
  34. # the check and gate queues.
  35. {toxinidir}/tools/run_bashate.sh {toxinidir}
  36. # Check the *.rst files
  37. doc8 README.rst CONTRIBUTING.rst doc/source --ignore D001
  38. # Check to make sure reno releasenotes created with 'reno new'
  39. {toxinidir}/tools/check-releasenotes.py
  40. [testenv:cover]
  41. setenv = VIRTUAL_ENV={envdir}
  42. LANGUAGE=en_US
  43. PYTHON=coverage run --source ironic --omit='*tests*' --parallel-mode
  44. commands =
  45. coverage erase
  46. stestr run {posargs}
  47. coverage combine
  48. coverage report --omit='*tests*'
  49. coverage html -d ./cover --omit='*tests*'
  50. [testenv:genconfig]
  51. sitepackages = False
  52. envdir = {toxworkdir}/venv
  53. commands =
  54. oslo-config-generator --config-file=tools/config/ironic-config-generator.conf
  55. [testenv:genpolicy]
  56. sitepackages = False
  57. envdir = {toxworkdir}/venv
  58. commands =
  59. oslopolicy-sample-generator --config-file=tools/policy/ironic-policy-generator.conf
  60. [testenv:debug]
  61. commands = oslo_debug_helper -t ironic/tests/unit {posargs}
  62. [testenv:docs]
  63. deps =
  64. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  65. -r{toxinidir}/doc/requirements.txt
  66. commands = sphinx-build -b html -W doc/source doc/build/html
  67. [testenv:pdf-docs]
  68. whitelist_externals = make
  69. deps = {[testenv:docs]deps}
  70. commands =
  71. sphinx-build -W -b latex doc/source doc/build/pdf
  72. make -C doc/build/pdf
  73. [testenv:api-ref]
  74. deps =
  75. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  76. -r{toxinidir}/doc/requirements.txt
  77. whitelist_externals = bash
  78. commands =
  79. bash -c 'rm -rf api-ref/build'
  80. sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
  81. [testenv:releasenotes]
  82. deps =
  83. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  84. -r{toxinidir}/doc/requirements.txt
  85. commands =
  86. sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  87. [testenv:venv]
  88. setenv = PYTHONHASHSEED=0
  89. deps =
  90. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  91. -r{toxinidir}/test-requirements.txt
  92. -r{toxinidir}/doc/requirements.txt
  93. commands = {posargs}
  94. [flake8]
  95. # [E129] visually indented line with same indent as next logical line
  96. # [E741] ambiguous variable name
  97. # [W503] Line break before binary operator.
  98. ignore = E129,E741,W503
  99. filename = *.py,app.wsgi
  100. exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
  101. import-order-style = pep8
  102. application-import-names = ironic
  103. max-complexity=18
  104. # [H106] Don't put vim configuration in source files.
  105. # [H203] Use assertIs(Not)None to check for None.
  106. # [H204] Use assert(Not)Equal to check for equality.
  107. # [H205] Use assert(Greater|Less)(Equal) for comparison.
  108. # [H210] Require ‘autospec’, ‘spec’, or ‘spec_set’ in mock.patch/mock.patch.object calls
  109. # [H904] Delay string interpolations at logging calls.
  110. enable-extensions=H106,H203,H204,H205,H210,H904
  111. # TODO(rpittau) remove the ignores below when we're ready to apply H210 to
  112. # the various modules. This can be done in batches changing the filters.
  113. per-file-ignores =
  114. ironic/cmd/__init__.py:E402
  115. ironic/tests/base.py:E402
  116. ironic/tests/unit/api/controllers/*:H210
  117. ironic/tests/unit/drivers/modules/test_console_utils.py:H210
  118. [hacking]
  119. import_exceptions = testtools.matchers, ironic.common.i18n
  120. [flake8:local-plugins]
  121. # [N323] Found use of _() without explicit import of _!
  122. extension =
  123. N323 = checks:check_explicit_underscore_import
  124. paths = ./ironic/hacking/
  125. [testenv:lower-constraints]
  126. deps =
  127. -c{toxinidir}/lower-constraints.txt
  128. -r{toxinidir}/test-requirements.txt
  129. -r{toxinidir}/requirements.txt
  130. [testenv:bandit]
  131. deps = -r{toxinidir}/test-requirements.txt
  132. commands = bandit -r ironic -x tests -n5 -ll -c tools/bandit.yml