OpenStack Networking (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.

121 lines
3.9KB

  1. [tox]
  2. envlist = py27,pep8
  3. minversion = 1.8
  4. skipsdist = True
  5. [testenv]
  6. # Note the hash seed is set to 0 until neutron can be tested with a
  7. # random hash seed successfully.
  8. setenv = VIRTUAL_ENV={envdir}
  9. PYTHONHASHSEED=0
  10. usedevelop = True
  11. install_command = pip install -U {opts} {packages}
  12. deps = -r{toxinidir}/requirements.txt
  13. -r{toxinidir}/test-requirements.txt
  14. whitelist_externals = sh
  15. commands =
  16. dsvm-functional: {toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}/etc {envdir}/bin
  17. sh tools/pretty_tox.sh '{posargs}'
  18. # there is also secret magic in pretty_tox.sh which lets you run in a fail only
  19. # mode. To do this define the TRACE_FAILONLY environmental variable.
  20. [testenv:hashtest]
  21. # This is the same as default environment, but with a random PYTHONHASHSEED.
  22. # You can also specify a specific hashseed (for test repeatability) as follows:
  23. # tox --hashseed 1235130571 -e hashtest
  24. setenv = VIRTUAL_ENV={envdir}
  25. [testenv:api]
  26. passenv = TEMPEST_CONFIG_DIR
  27. setenv = OS_TEST_PATH=./neutron/tests/api
  28. OS_TEST_API_WITH_REST=1
  29. # If you are running the tests locally you should set the env variable
  30. # TEMPEST_CONFIG_DIR=/opt/stack/tempest/etc
  31. [testenv:functional]
  32. setenv = OS_TEST_PATH=./neutron/tests/functional
  33. OS_TEST_TIMEOUT=180
  34. deps =
  35. {[testenv]deps}
  36. -r{toxinidir}/neutron/tests/functional/requirements.txt
  37. [testenv:dsvm-functional]
  38. setenv = OS_TEST_PATH=./neutron/tests/functional
  39. OS_SUDO_TESTING=1
  40. OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
  41. OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
  42. OS_FAIL_ON_MISSING_DEPS=1
  43. OS_TEST_TIMEOUT=180
  44. sitepackages=True
  45. deps =
  46. {[testenv:functional]deps}
  47. [testenv:fullstack]
  48. setenv = OS_TEST_PATH=./neutron/tests/fullstack
  49. OS_TEST_TIMEOUT=180
  50. deps =
  51. {[testenv]deps}
  52. -r{toxinidir}/neutron/tests/functional/requirements.txt
  53. [testenv:dsvm-fullstack]
  54. setenv = OS_TEST_PATH=./neutron/tests/fullstack
  55. OS_SUDO_TESTING=1
  56. OS_ROOTWRAP_CMD=sudo {envdir}/bin/neutron-rootwrap {envdir}/etc/neutron/rootwrap.conf
  57. OS_ROOTWRAP_DAEMON_CMD=sudo {envdir}/bin/neutron-rootwrap-daemon {envdir}/etc/neutron/rootwrap.conf
  58. OS_FAIL_ON_MISSING_DEPS=1
  59. OS_TEST_TIMEOUT=180
  60. sitepackages=True
  61. deps =
  62. {[testenv:functional]deps}
  63. [tox:jenkins]
  64. sitepackages = True
  65. downloadcache = ~/cache/pip
  66. [testenv:pep8]
  67. deps =
  68. {[testenv]deps}
  69. pylint
  70. commands=
  71. # If it is easier to add a check via a shell script, consider adding it in this file
  72. sh ./tools/misc-sanity-checks.sh
  73. {toxinidir}/tools/check_unit_test_structure.sh
  74. # Checks for coding and style guidelines
  75. flake8
  76. sh ./tools/coding-checks.sh --pylint '{posargs}'
  77. neutron-db-manage check_migration
  78. whitelist_externals =
  79. sh
  80. bash
  81. [testenv:cover]
  82. commands =
  83. python setup.py testr --coverage --testr-args='{posargs}'
  84. [testenv:venv]
  85. commands = {posargs}
  86. [testenv:docs]
  87. commands = sphinx-build -W -b html doc/source doc/build
  88. [flake8]
  89. # E125 continuation line does not distinguish itself from next logical line
  90. # E126 continuation line over-indented for hanging indent
  91. # E128 continuation line under-indented for visual indent
  92. # E129 visually indented line with same indent as next logical line
  93. # E265 block comment should start with ‘# ‘
  94. # H305 imports not grouped correctly
  95. # H404 multi line docstring should start with a summary
  96. # H405 multi line docstring summary not separated with an empty line
  97. ignore = E125,E126,E128,E129,E265,H305,H404,H405
  98. show-source = true
  99. builtins = _
  100. # neutron/tests/tempest needs to be excluded so long as it continues
  101. # to be copied directly from tempest, since tempest and neutron do not
  102. # share a flake8 configuration.
  103. exclude = ./.*,build,dist,neutron/openstack/common/*,neutron/tests/tempest
  104. [hacking]
  105. import_exceptions = neutron.i18n
  106. local-check-factory = neutron.hacking.checks.factory