Neutron integration with OVN
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.

151 lines
4.6KB

  1. [tox]
  2. minversion = 2.0
  3. envlist = py37,pep8,docs
  4. skipsdist = True
  5. [testenv]
  6. basepython = python3
  7. usedevelop = True
  8. install_command = pip install {opts} {packages}
  9. setenv =
  10. VIRTUAL_ENV={envdir}
  11. PYTHONWARNINGS=default::DeprecationWarning,ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site
  12. deps = -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
  13. -r{toxinidir}/requirements.txt
  14. -r{toxinidir}/test-requirements.txt
  15. whitelist_externals = bash
  16. rm
  17. make
  18. commands =
  19. {toxinidir}/tools/pip_install_src_modules.sh "{toxinidir}"
  20. {toxinidir}/tools/ostestr_compat_shim.sh {posargs}
  21. passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY TOX_ENV_SRC_MODULES
  22. [testenv:pep8]
  23. envdir = {toxworkdir}/shared
  24. whitelist_externals = {[testenv:genconfig]whitelist_externals}
  25. commands = flake8
  26. {toxinidir}/tools/check_unit_test_structure.sh
  27. {toxinidir}/tools/coding-checks.sh --pylint '{posargs}'
  28. neutron-db-manage --subproject=networking-ovn check_migration
  29. {[testenv:genconfig]commands}
  30. {[testenv:bandit]commands}
  31. [testenv:venv]
  32. commands = {posargs}
  33. [testenv:functional]
  34. setenv =
  35. {[testenv]setenv}
  36. OS_TEST_PATH=./networking_ovn/tests/functional
  37. OS_TEST_TIMEOUT=240
  38. deps = {[testenv]deps}
  39. -r{toxinidir}/networking_ovn/tests/functional/requirements.txt
  40. [testenv:dsvm]
  41. # Fake job to define environment variables shared between dsvm jobs
  42. setenv = OS_TEST_TIMEOUT=240
  43. OS_LOG_PATH={env:OS_LOG_PATH:/opt/stack/logs}
  44. commands = false
  45. [testenv:dsvm-functional]
  46. setenv = {[testenv:functional]setenv}
  47. {[testenv:dsvm]setenv}
  48. deps = {[testenv:functional]deps}
  49. commands =
  50. {toxinidir}/tools/ostestr_compat_shim.sh {posargs}
  51. [testenv:cover]
  52. envdir = {toxworkdir}/shared
  53. setenv =
  54. {[testenv]setenv}
  55. PYTHON=coverage run --source networking_ovn --parallel-mode
  56. commands =
  57. stestr run --no-subunit-trace {posargs}
  58. coverage combine
  59. coverage report --fail-under=75 --skip-covered
  60. coverage html -d cover
  61. coverage xml -o cover/coverage.xml
  62. [testenv:docs]
  63. envdir = {toxworkdir}/docs
  64. deps = -r{toxinidir}/doc/requirements.txt
  65. commands =
  66. rm -rf doc/build/html
  67. doc8 doc/source devstack releasenotes/source vagrant rally-jobs
  68. sphinx-build -W -b html doc/source doc/build/html
  69. [testenv:pdf-docs]
  70. envdir = {toxworkdir}/docs
  71. deps = {[testenv:docs]deps}
  72. commands =
  73. rm -rf doc/build/pdf
  74. sphinx-build -W -b latex doc/source doc/build/pdf
  75. make -C doc/build/pdf
  76. [testenv:debug]
  77. envdir = {toxworkdir}/shared
  78. commands = oslo_debug_helper -t networking_ovn/tests {posargs}
  79. [testenv:genconfig]
  80. envdir = {toxworkdir}/shared
  81. commands =
  82. mkdir -p etc/neutron/plugins/ml2
  83. oslo-config-generator --config-file etc/oslo-config-generator/ml2_conf.ini
  84. oslo-config-generator --config-file etc/oslo-config-generator/networking_ovn_metadata_agent.ini
  85. whitelist_externals = mkdir
  86. [testenv:releasenotes]
  87. envdir = {toxworkdir}/docs
  88. deps = -r{toxinidir}/doc/requirements.txt
  89. commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  90. [doc8]
  91. # File extensions to check
  92. extensions = .rst
  93. [flake8]
  94. # E123 closing bracket does not match indentation of opening bracket’s line
  95. # N530 direct neutron imports not allowed
  96. # W504 line break after binary operator
  97. ignore = E123,N530,W504
  98. # H106: Don't put vim configuration in source files
  99. # H203: Use assertIs(Not)None to check for None
  100. # H204: Use assert(Not)Equal to check for equality
  101. # H205: Use assert(Greater|Less)(Equal) for comparison
  102. # H904: Delay string interpolations at logging calls
  103. enable-extensions=H106,H203,H204,H205,H904
  104. show-source = True
  105. exclude=./.*,dist,doc,*egg*,build,releasenotes
  106. import-order-style = pep8
  107. [hacking]
  108. import_exceptions = networking_ovn
  109. local-check-factory = neutron_lib.hacking.checks.factory
  110. [testenv:lower-constraints]
  111. deps =
  112. -c{toxinidir}/lower-constraints.txt
  113. -r{toxinidir}/test-requirements.txt
  114. -r{toxinidir}/requirements.txt
  115. [testenv:bandit]
  116. envdir = {toxworkdir}/shared
  117. # B104: Possible binding to all interface
  118. deps = -r{toxinidir}/test-requirements.txt
  119. commands = bandit -r networking_ovn -x tests -n5 -s B104
  120. [testenv:dev]
  121. # run locally (not in the gate) using editable mode
  122. # https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
  123. commands =
  124. pip install -q -e "git+https://git.openstack.org/openstack/neutron#egg=neutron"
  125. {[testenv]commands}
  126. [testenv:pep8-dev]
  127. deps =
  128. {[testenv]deps}
  129. commands =
  130. {[testenv:dev]commands}
  131. {[testenv:pep8]commands}