Unified SDK for OpenStack
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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. [tox]
  2. minversion = 3.1
  3. envlist = pep8,py37,py36,py35,py27
  4. skipsdist = True
  5. ignore_basepython_conflict = True
  6. [testenv]
  7. usedevelop = True
  8. install_command = pip install {opts} {packages}
  9. passenv = OS_* OPENSTACKSDK_*
  10. basepython = {env:OPENSTACKSDK_TOX_PYTHON:python3}
  11. setenv =
  12. VIRTUAL_ENV={envdir}
  13. LANG=en_US.UTF-8
  14. LANGUAGE=en_US:en
  15. LC_ALL=C
  16. OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
  17. OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
  18. OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
  19. deps =
  20. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  21. -r{toxinidir}/test-requirements.txt
  22. -r{toxinidir}/requirements.txt
  23. commands = stestr run {posargs}
  24. stestr slowest
  25. [testenv:examples]
  26. commands = stestr --test-path ./openstack/tests/examples run {posargs}
  27. stestr slowest
  28. [testenv:functional]
  29. # Some jobs (especially heat) takes longer, therefore increase default timeout
  30. # This timeout should not be smaller, than the longest individual timeout
  31. setenv =
  32. {[testenv]setenv}
  33. OS_TEST_TIMEOUT=600
  34. OPENSTACKSDK_FUNC_TEST_TIMEOUT_LOAD_BALANCER=600
  35. commands = stestr --test-path ./openstack/tests/functional/{env:OPENSTACKSDK_TESTS_SUBDIR:} run --serial {posargs}
  36. stestr slowest
  37. [testenv:pep8]
  38. commands =
  39. flake8
  40. doc8 doc/source README.rst
  41. [hacking]
  42. local-check-factory = openstack._hacking.factory
  43. [testenv:venv]
  44. commands = {posargs}
  45. [testenv:debug]
  46. # allow 1 year, or 31536000 seconds, to debug a test before it times out
  47. setenv = OS_TEST_TIMEOUT=31536000
  48. whitelist_externals = find
  49. commands =
  50. find . -type f -name "*.pyc" -delete
  51. oslo_debug_helper -t openstack/tests {posargs}
  52. [testenv:cover]
  53. setenv =
  54. {[testenv]setenv}
  55. PYTHON=coverage run --source openstack --parallel-mode
  56. commands =
  57. stestr run {posargs}
  58. coverage combine
  59. coverage html -d cover
  60. coverage xml -o cover/coverage.xml
  61. [testenv:ansible]
  62. # Need to pass some env vars for the Ansible playbooks
  63. basepython = {env:OPENSTACKSDK_TOX_PYTHON:python2}
  64. passenv = HOME USER ANSIBLE_VAR_*
  65. deps =
  66. {[testenv]deps}
  67. ansible
  68. commands = {toxinidir}/extras/run-ansible-tests.sh -e {envdir} {posargs}
  69. [testenv:docs]
  70. deps =
  71. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  72. -r{toxinidir}/requirements.txt
  73. -r{toxinidir}/doc/requirements.txt
  74. commands = sphinx-build -W -d doc/build/doctrees -b html doc/source/ doc/build/html
  75. [testenv:releasenotes]
  76. deps =
  77. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  78. -r{toxinidir}/requirements.txt
  79. -r{toxinidir}/doc/requirements.txt
  80. commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  81. [flake8]
  82. # The following are ignored on purpose. It's not super worth it to fix them.
  83. # However, if you feel strongly about it, patches will be accepted to fix them
  84. # if they fix ALL of the occurances of one and only one of them.
  85. # H306 Is about alphabetical imports - there's a lot to fix.
  86. # H4 Are about docstrings and there's just a huge pile of pre-existing issues.
  87. # W503 Is supposed to be off by default but in the latest pycodestyle isn't.
  88. # Also, both openstacksdk and Donald Knuth disagree with the rule. Line
  89. # breaks should occur before the binary operator for readability.
  90. ignore = H306,H4,W503
  91. show-source = True
  92. exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build
  93. [doc8]
  94. extensions = .rst, .yaml
  95. [testenv:lower-constraints]
  96. deps =
  97. -c{toxinidir}/lower-constraints.txt
  98. -r{toxinidir}/test-requirements.txt
  99. -r{toxinidir}/requirements.txt