Neutron drivers for OpenDaylight.
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 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. [tox]
  2. envlist = docs,py35,py27,pep8
  3. minversion = 1.6
  4. skipsdist = True
  5. [testenv]
  6. setenv = VIRTUAL_ENV={envdir}
  7. PYTHONWARNINGS=default::DeprecationWarning
  8. OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:1}
  9. OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:1}
  10. OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:1}
  11. OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:60}
  12. passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
  13. OS_FAIL_ON_MISSING_DEPS OS_POST_MORTEM_DEBUGGER TRACE_FAILONLY
  14. OS_TEST_DBAPI_ADMIN_CONNECTION OS_DEBUG
  15. usedevelop = True
  16. deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  17. -r{toxinidir}/requirements.txt
  18. -r{toxinidir}/test-requirements.txt
  19. whitelist_externals = bash
  20. commands = stestr run {posargs}
  21. [testenv:dsvm]
  22. basepython = python3
  23. # Fake job to define environment variables shared between dsvm jobs
  24. setenv = OS_SUDO_TESTING=1
  25. OS_FAIL_ON_MISSING_DEPS=1
  26. OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
  27. commands = false
  28. [testenv:functional]
  29. setenv = {[testenv]setenv}
  30. OS_TEST_PATH=./networking_odl/tests/functional
  31. OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
  32. deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  33. -r{toxinidir}/requirements.txt
  34. -r{toxinidir}/networking_odl/tests/functional/requirements.txt
  35. [testenv:dsvm-functional]
  36. basepython = python2.7
  37. setenv = {[testenv:functional]setenv}
  38. {[testenv:dsvm]setenv}
  39. deps =
  40. {[testenv:functional]deps}
  41. [testenv:pep8]
  42. deps = {[testenv]deps}
  43. -r{toxinidir}/doc/requirements.txt
  44. basepython = python3
  45. commands =
  46. flake8
  47. {toxinidir}/tools/coding-checks.sh --pylint '{posargs}'
  48. doc8 doc/source devstack releasenotes/source rally-jobs
  49. neutron-db-manage --subproject networking-odl check_migration
  50. {[testenv:genconfig]commands}
  51. {[testenv:bashate]commands}
  52. {[testenv:capitald]commands}
  53. {[testenv:bandit]commands}
  54. whitelist_externals =
  55. bash
  56. mkdir
  57. [testenv:i18n]
  58. basepython = python3
  59. commands = python ./tools/check_i18n.py ./networking_odl ./tools/i18n_cfg.py
  60. [testenv:venv]
  61. basepython = python3
  62. deps = {[testenv]deps}
  63. -r{toxinidir}/doc/requirements.txt
  64. commands = {posargs}
  65. [testenv:cover]
  66. basepython = python3
  67. setenv =
  68. PYTHON=coverage run --source networking_odl --parallel-mode
  69. commands =
  70. stestr run {posargs}
  71. coverage combine
  72. coverage report --fail-under=80 --skip-covered
  73. coverage html -d cover
  74. coverage xml -o cover/coverage.xml
  75. [testenv:docs]
  76. basepython = python3
  77. whitelist_externals = rm
  78. deps =
  79. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  80. -r{toxinidir}/doc/requirements.txt
  81. commands =
  82. rm -rf doc/build
  83. sphinx-build -W -b html doc/source doc/build/html
  84. [testenv:debug]
  85. basepython = python3
  86. # Uses default base python
  87. setenv = {[testenv]setenv}
  88. OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:0}
  89. OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:0}
  90. OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:0}
  91. OS_TEST_TIMEOUT={env:OS_TEST_TIMEOUT:0}
  92. commands = oslo_debug_helper -t networking_odl/tests {posargs}
  93. [testenv:debug-py27]
  94. basepython = python2.7
  95. setenv = {[testenv]setenv}
  96. {[testenv:debug]setenv}
  97. commands = {[testenv:debug]commands}
  98. [testenv:debug-py35]
  99. basepython = python3.5
  100. setenv = {[testenv]setenv}
  101. {[testenv:debug]setenv}
  102. commands = {[testenv:debug]commands}
  103. [hacking]
  104. import_exceptions = networking_odl._i18n
  105. local-check-factory = networking_odl.hacking.checks.factory
  106. [testenv:bandit]
  107. basepython = python3
  108. # B101: Use of assert detected
  109. deps = -r{toxinidir}/test-requirements.txt
  110. commands = bandit -r networking_odl -x tests -n5 -s B101
  111. [doc8]
  112. # File extensions to check
  113. extensions = .rst
  114. # TODO(yamahata): doc8 work around. remove this when doc8 is fixed.
  115. # doc8(actually docutils) handles relative path inclusion differently from sphinx.
  116. # doc8 wrongly alerts invalid inclusion path with recursive relative inclusion
  117. # https://sourceforge.net/p/docutils/bugs/211/
  118. ignore-path-errors=doc/source/devref/index.rst;D000
  119. [flake8]
  120. # TODO(dougwig) -- uncomment this to test for remaining linkages
  121. # N530 direct neutron imports not allowed
  122. show-source = True
  123. # TODO(mkolesni): Fix I202 if you really care about import checks
  124. ignore = N530,I202
  125. # H106: Dont put vim configuration in source files
  126. # H203: Use assertIs(Not)None to check for None
  127. # H204: Use assert(Not)Equal to check for equality
  128. # H205: Use assert(Greater|Less)(Equal) for comparison
  129. # H904: Delay string interpolations at logging calls
  130. enable-extensions=H106,H203,H204,H205,H904
  131. exclude=./.*,dist,doc,releasenotes,*lib/python*,*egg,build,tools
  132. import-order-style = pep8
  133. [testenv:bashate]
  134. basepython = python3
  135. commands = bash -c "find {toxinidir} \
  136. -not \( -type d -name .\?\* -prune \) \
  137. -type f \
  138. \( \
  139. -name \*.sh \
  140. -or \
  141. -path \*/devstack/\*settings\* \
  142. -or \
  143. -path \*/devstack/devstackgaterc \
  144. -or \
  145. -path \*/devstack/entry_points \
  146. -or \
  147. -path \*/devstack/functions \
  148. -or \
  149. -path \*/devstack/odl-releases/common \
  150. -or \
  151. -path \*/devstack/override-defaults \
  152. \) \
  153. # E005 file does not begin with #! or have a .sh prefix
  154. # E006 check for lines longer than 79 columns
  155. # E042 local declaration hides errors
  156. # E043 Arithmetic compound has inconsistent return semantics
  157. -print0 | xargs -0 bashate -v -iE006 -eE005,E042,E043"
  158. whitelist_externals = bash
  159. [testenv:capitald]
  160. basepython = python3
  161. usedevelop = False
  162. skip_install = True
  163. deps =
  164. # Check if "Opendaylight" word is in any file
  165. # Only "OpenDaylight" (with uppercase 'D') should be used
  166. commands = bash -c "! grep \
  167. --exclude-dir='.*' \
  168. --exclude-dir='cover' \
  169. --exclude-dir='__pycache__' \
  170. --exclude='tox.ini' \
  171. --exclude='ChangeLog' \
  172. --exclude='*.py' \
  173. --exclude='*.pyc' \
  174. --exclude='*~' \
  175. --recursive \
  176. --line-number \
  177. Opendaylight \
  178. {toxinidir}"
  179. whitelist_externals = bash
  180. [testenv:genconfig]
  181. basepython = python3
  182. deps = -r{toxinidir}/requirements.txt
  183. commands =
  184. mkdir -p etc/neutron/plugins/ml2
  185. oslo-config-generator --namespace ml2_odl --output-file etc/neutron/plugins/ml2/ml2_conf_odl.ini.sample
  186. whitelist_externals = mkdir
  187. [testenv:releasenotes]
  188. basepython = python3
  189. deps =
  190. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  191. -r{toxinidir}/doc/requirements.txt
  192. commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  193. [testenv:lower-constraints]
  194. basepython = python3
  195. deps =
  196. -c{toxinidir}/lower-constraints.txt
  197. -r{toxinidir}/test-requirements.txt
  198. -r{toxinidir}/requirements.txt
  199. [testenv:dev]
  200. # run locally (not in the gate) using editable mode
  201. # https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
  202. # note that order is important to ensure dependencies don't override
  203. commands =
  204. pip install -q -e "git+https://git.openstack.org/openstack/networking-l2gw#egg=networking_l2gw"
  205. pip install -q -e "git+https://git.openstack.org/openstack/networking-bgpvpn#egg=networking_bgpvpn"
  206. pip install -q -e "git+https://git.openstack.org/openstack/networking-sfc#egg=networking_sfc"
  207. pip install -q -e "git+https://git.openstack.org/openstack/neutron-lbaas#egg=neutron_lbaas"
  208. pip install -q -e "git+https://git.openstack.org/openstack/neutron-fwaas#egg=neutron_fwaas"
  209. pip install -q -e "git+https://git.openstack.org/openstack/ceilometer#egg=ceilometer"
  210. pip install -q -e "git+https://git.openstack.org/openstack/neutron#egg=neutron"
  211. [testenv:py27-dev]
  212. basepython = python27
  213. commands =
  214. {[testenv:dev]commands}
  215. {[testenv]commands}
  216. [testenv:py3-dev]
  217. basepython = python3
  218. commands =
  219. {[testenv:dev]commands}
  220. {[testenv]commands}
  221. [testenv:pep8-dev]
  222. deps = {[testenv]deps}
  223. -r{toxinidir}/doc/requirements.txt
  224. commands =
  225. {[testenv:dev]commands}
  226. {[testenv:pep8]commands}