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.

tox.ini 3.7KB

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