A Python agent for provisioning and deprovisioning 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.

122 lines
3.5KB

  1. [tox]
  2. minversion = 3.1.0
  3. skipsdist = True
  4. envlist = py3,functional,pep8
  5. ignore_basepython_conflict=true
  6. [testenv]
  7. usedevelop = True
  8. basepython = python3
  9. setenv =
  10. VIRTUAL_ENV={envdir}
  11. PYTHONDONTWRITEBYTECODE = 1
  12. OS_TEST_PATH=./ironic_python_agent/tests/unit
  13. LANGUAGE=en_US
  14. LC_ALL=en_US.utf-8
  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 = stestr run {posargs}
  20. passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
  21. [testenv:functional]
  22. usedevelop = True
  23. # Define virtualenv directory, port to use for functional testing, and number
  24. # of seconds to wait for the agent to come alive during functional testing.
  25. setenv =
  26. VIRTUAL_ENV={envdir}
  27. PYTHONDONTWRITEBYTECODE = 1
  28. OS_TEST_PATH=./ironic_python_agent/tests/functional
  29. TEST_PORT=9999
  30. IPA_WAIT_TRIES=100
  31. commands = stestr run {posargs}
  32. [testenv:pep8]
  33. whitelist_externals = bash
  34. commands =
  35. flake8 {posargs:ironic_python_agent imagebuild}
  36. # Run bashate during pep8 runs to ensure violations are caught by
  37. # the check and gate queues.
  38. {toxinidir}/tools/run_bashate.sh {toxinidir}
  39. doc8 doc/source README.rst
  40. [testenv:cover]
  41. setenv = VIRTUAL_ENV={envdir}
  42. PYTHON=coverage run --source ironic_python_agent --omit='*tests*' --parallel-mode
  43. commands =
  44. coverage erase
  45. stestr run {posargs}
  46. coverage combine
  47. coverage report --omit='*tests*'
  48. coverage html -d ./cover --omit='*tests*'
  49. [testenv:venv]
  50. setenv = PYTHONHASHSEED=0
  51. commands = {posargs:}
  52. [testenv:debug]
  53. envdir = {toxworkdir}/venv
  54. commands = oslo_debug_helper -t ironic_python_agent/tests/unit {posargs}
  55. [testenv:docs]
  56. setenv = PYTHONHASHSEED=0
  57. sitepackages = False
  58. commands =
  59. sphinx-build -b html doc/source doc/build/html
  60. [testenv:pdf-docs]
  61. whitelist_externals = make
  62. setenv = PYTHONHASHSEED=0
  63. sitepackages = False
  64. commands =
  65. sphinx-build -b latex doc/source doc/build/pdf
  66. make -C doc/build/pdf
  67. [testenv:releasenotes]
  68. commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  69. [flake8]
  70. # [E129] visually indented line with same indent as next logical line.
  71. # [W503] Line break before binary operator.
  72. ignore = E129,W503
  73. exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,tools,imagebuild/tinyipa/tinyipafinal,imagebuild/tinyipa/tinyipabuild
  74. import-order-style = pep8
  75. application-import-names = ironic_python_agent
  76. # [H106] Don't put vim configuration in source files.
  77. # [H203] Use assertIs(Not)None to check for None.
  78. # [H204] Use assert(Not)Equal to check for equality.
  79. # [H205] Use assert(Greater|Less)(Equal) for comparison.
  80. # [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls
  81. # [H904] Delay string interpolations at logging calls.
  82. enable-extensions=H106,H203,H204,H205,H210,H904
  83. [hacking]
  84. import_exceptions = ironic.openstack.common.gettextutils._,testtools.matchers
  85. [testenv:checkconfig]
  86. sitepackages = False
  87. envdir = {toxworkdir}/venv
  88. commands =
  89. {toxinidir}/tools/config/check_uptodate.sh
  90. [testenv:genconfig]
  91. sitepackages = False
  92. envdir = {toxworkdir}/venv
  93. whitelist_externals = mkdir
  94. commands =
  95. mkdir -p etc/ironic_python_agent
  96. oslo-config-generator --config-file=tools/config/ipa-config-generator.conf
  97. [testenv:lower-constraints]
  98. deps =
  99. -c{toxinidir}/lower-constraints.txt
  100. -r{toxinidir}/test-requirements.txt
  101. -r{toxinidir}/requirements.txt
  102. [testenv:bandit]
  103. deps = -r{toxinidir}/test-requirements.txt
  104. commands = bandit -r ironic_python_agent -x tests -n5 -ll -c tools/bandit.yml