Firewall services for OpenStack Neutron.
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 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. [tox]
  2. envlist = py36,py35,py27,pep8,pylint
  3. minversion = 2.0
  4. skipsdist = True
  5. [testenv]
  6. setenv = VIRTUAL_ENV={envdir}
  7. PYTHONWARNINGS=default::DeprecationWarning
  8. usedevelop = True
  9. deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  10. -r{toxinidir}/requirements.txt
  11. -r{toxinidir}/test-requirements.txt
  12. whitelist_externals =
  13. sh
  14. find
  15. commands =
  16. find . -type f -name "*.py[c|o]" -delete
  17. find . -path "*/__pycache__*" -delete
  18. stestr run {posargs}
  19. [testenv:common]
  20. # Fake job to define environment variables shared between dsvm/non-dsvm jobs
  21. setenv = OS_TEST_TIMEOUT=180
  22. commands = false
  23. [testenv:dsvm]
  24. basepython = python3
  25. # Fake job to define environment variables shared between dsvm jobs
  26. setenv = OS_SUDO_TESTING=1
  27. OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
  28. OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
  29. OS_FAIL_ON_MISSING_DEPS=1
  30. OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
  31. commands = false
  32. [testenv:functional]
  33. #TODO(njohnston): Fix failures blocking dsvm-functional converting to py3
  34. setenv = {[testenv]setenv}
  35. {[testenv:common]setenv}
  36. OS_TEST_PATH=./neutron_fwaas/tests/functional
  37. OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
  38. commands =
  39. stestr run {posargs}
  40. [testenv:dsvm-fullstack]
  41. basepython = python3
  42. setenv = {[testenv]setenv}
  43. {[testenv:common]setenv}
  44. {[testenv:dsvm]setenv}
  45. # workaround for DB teardown lock contention (bug/1541742)
  46. OS_TEST_TIMEOUT=600
  47. OS_TEST_PATH=./neutron_fwaas/tests/fullstack
  48. sitepackages=True
  49. [testenv:api]
  50. basepython = python3
  51. sitepackages=True
  52. setenv =
  53. OS_TEST_PATH=./neutron_fwaas/tests/tempest_plugin/tests/api/
  54. OS_TESTR_CONCURRENCY=1
  55. TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
  56. commands =
  57. stestr run {posargs}
  58. [testenv:scenario]
  59. basepython = python3
  60. sitepackages=True
  61. setenv =
  62. OS_TEST_PATH=./neutron_fwaas/tests/tempest_plugin/tests/scenario/
  63. OS_TESTR_CONCURRENCY=1
  64. TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
  65. commands =
  66. stestr run {posargs}
  67. [testenv:dsvm-functional]
  68. setenv =
  69. OS_TEST_PATH=./neutron_fwaas/tests/functional
  70. OS_SUDO_TESTING=1
  71. OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
  72. OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
  73. OS_FAIL_ON_MISSING_DEPS=1
  74. OS_NEUTRON_PATH={env:OS_NEUTRON_PATH:/opt/stack/new/neutron}
  75. whitelist_externals =
  76. sh
  77. cp
  78. sudo
  79. commands =
  80. {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
  81. stestr run {posargs}
  82. [testenv:releasenotes]
  83. basepython = python3
  84. deps = -r{toxinidir}/doc/requirements.txt
  85. commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  86. [testenv:pep8]
  87. basepython = python3
  88. commands =
  89. flake8
  90. doc8 {posargs}
  91. {toxinidir}/tools/check_unit_test_structure.sh
  92. neutron-db-manage --subproject neutron-fwaas --database-connection sqlite:// check_migration
  93. {[testenv:genconfig]commands}
  94. {[testenv:genpolicy]commands}
  95. whitelist_externals = sh
  96. [testenv:cover]
  97. basepython = python3
  98. setenv = VIRTUAL_ENV={envdir}
  99. LANGUAGE=en_US
  100. PYTHON=coverage run --source neutron_fwaas --omit='*tests*' --parallel-mode
  101. commands =
  102. coverage erase
  103. stestr run {posargs}
  104. coverage combine
  105. coverage report --skip-covered --omit='*test*'
  106. coverage html -d cover
  107. coverage xml -o cover/coverage.xml
  108. [testenv:venv]
  109. basepython = python3
  110. commands = {posargs}
  111. deps = -r{toxinidir}/doc/requirements.txt
  112. [testenv:docs]
  113. basepython = python3
  114. deps = -r{toxinidir}/doc/requirements.txt
  115. commands =
  116. rm -rf doc/source/contributor/api
  117. sphinx-build -W -b html doc/source doc/build/html
  118. [doc8]
  119. ignore = D000
  120. ignore-path = .venv,.git,.tox,.tmp,*neutron_fwaas/locale*,*lib/python*,neutron_fwaas.egg*,doc/build,releasenotes/*,doc/source/contributor/api,requirements.txt,test-requirements.txt
  121. [flake8]
  122. # E125 continuation line does not distinguish itself from next logical line
  123. # E126 continuation line over-indented for hanging indent
  124. # E128 continuation line under-indented for visual indent
  125. # E129 visually indented line with same indent as next logical line
  126. # E265 block comment should start with '# '
  127. # H404 multi line docstring should start with a summary
  128. # H405 multi line docstring summary not separated with an empty line
  129. # TODO(dougwig) -- uncomment this to test for remaining linkages
  130. # N530 direct neutron imports not allowed
  131. # TODO(ihrachys) -- reenable N537 when new neutron-lib release is available
  132. # H106: Do not put vim configuration in source files
  133. # H203: Use assertIs(Not)None to check for None
  134. # H204: Use assert(Not)Equal to check for equality
  135. # H205: Use assert(Greater|Less)(Equal) for comparison
  136. # H904: Delay string interpolations at logging calls
  137. # N521: jsonutils.loads must be used instead of json.loads
  138. ignore = E125,E126,E128,E129,E265,H404,H405,N530,N521
  139. enable-extensions=H106,H203,H204,H205,H904
  140. show-source = true
  141. exclude = .venv,.git,.tox,dist,doc,*lib/python*,.tmp,*egg,build,tools,.ropeproject,rally-scenarios
  142. import-order-style = pep8
  143. [testenv:pylint]
  144. basepython = python3
  145. deps =
  146. {[testenv]deps}
  147. pylint
  148. commands =
  149. pylint --rcfile=.pylintrc --output-format=colorized {posargs:neutron_fwaas}
  150. [hacking]
  151. import_exceptions = neutron_fwaas._i18n
  152. local-check-factory = neutron_lib.hacking.checks.factory
  153. [testenv:genconfig]
  154. basepython = python3
  155. commands = {toxinidir}/tools/generate_config_file_samples.sh
  156. [testenv:genpolicy]
  157. commands = oslopolicy-sample-generator --config-file=etc/oslo-policy-generator/policy.conf
  158. [testenv:lower-constraints]
  159. basepython = python3
  160. deps =
  161. -c{toxinidir}/lower-constraints.txt
  162. -r{toxinidir}/test-requirements.txt
  163. -r{toxinidir}/requirements.txt
  164. [testenv:dev]
  165. # run locally (not in the gate) using editable mode
  166. # https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
  167. commands =
  168. pip install -q -e "git+https://git.openstack.org/openstack/neutron#egg=neutron"
  169. [testenv:py3-dev]
  170. basepython = python3
  171. commands =
  172. {[testenv:dev]commands}
  173. {[testenv]commands}
  174. [testenv:pep8-dev]
  175. deps =
  176. {[testenv]deps}
  177. commands =
  178. {[testenv:dev]commands}
  179. {[testenv:pep8]commands}