OpenStack Dashboard (Horizon)
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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. [tox]
  2. envlist = pep8,py27,py36,py37,py3-dj111,releasenotes,npm
  3. minversion = 2.5.0
  4. skipsdist = True
  5. [testenv]
  6. install_command = pip install {opts} {packages}
  7. usedevelop = True
  8. setenv =
  9. VIRTUAL_ENV={envdir}
  10. whitelist_externals =
  11. bash
  12. find
  13. deps =
  14. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  15. -r{toxinidir}/test-requirements.txt
  16. -r{toxinidir}/requirements.txt
  17. commands = {[unit_tests]commands}
  18. [unit_tests]
  19. commands =
  20. find . -type f -name "*.pyc" -delete
  21. bash {toxinidir}/tools/unit_tests.sh {envpython} {toxinidir} {posargs}
  22. [testenv:py3-dj21]
  23. basepython = python3
  24. commands =
  25. pip install django>=2.1<2.2
  26. {[unit_tests]commands}
  27. [testenv:py3-dj111]
  28. basepython = python3
  29. commands =
  30. pip install django>=1.11,<2
  31. {[unit_tests]commands}
  32. [testenv:lower-constraints]
  33. basepython = python3
  34. deps =
  35. -c{toxinidir}/lower-constraints.txt
  36. -r{toxinidir}/test-requirements.txt
  37. -r{toxinidir}/requirements.txt
  38. [testenv:venv]
  39. basepython = python3
  40. commands = {posargs}
  41. [testenv:pep8]
  42. basepython = python3
  43. # NOTE: Due to doc dependencies, we don't share envdir with "venv".
  44. # sphinx (precisely Pygments) needs to be installed to make doc8 work properly
  45. deps =
  46. {[testenv]deps}
  47. -r{toxinidir}/doc/requirements.txt
  48. setenv =
  49. {[testenv]setenv}
  50. DJANGO_SETTINGS_MODULE=openstack_dashboard.test.settings
  51. commands =
  52. flake8 {posargs}
  53. {envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only
  54. bash {toxinidir}/tools/find_executables.sh
  55. doc8 doc/source releasenotes/source releasenotes/notes
  56. pylint -j 4 --verbose --rcfile=.pylintrc -f colorized openstack_dashboard openstack_auth horizon
  57. [testenv:cover]
  58. basepython = python3
  59. envdir = {toxworkdir}/venv
  60. commands =
  61. coverage erase
  62. coverage run {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
  63. coverage run -a {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-tag integration {posargs}
  64. coverage run -a {toxinidir}/manage.py test openstack_auth --settings=openstack_auth.tests.settings {posargs}
  65. coverage xml
  66. coverage html
  67. [testenv:selenium]
  68. basepython = python3
  69. envdir = {toxworkdir}/venv
  70. setenv =
  71. {[testenv]setenv}
  72. WITH_SELENIUM=1
  73. SKIP_UNITTESTS=1
  74. commands = {[unit_tests]commands}
  75. [testenv:selenium-headless]
  76. basepython = python3
  77. envdir = {toxworkdir}/venv
  78. setenv =
  79. {[testenv]setenv}
  80. SELENIUM_HEADLESS=1
  81. WITH_SELENIUM=1
  82. SKIP_UNITTESTS=1
  83. commands = {[unit_tests]commands}
  84. [testenv:selenium-phantomjs]
  85. basepython = python3
  86. envdir = {toxworkdir}/venv
  87. setenv =
  88. {[testenv]setenv}
  89. SELENIUM_PHANTOMJS=1
  90. WITH_SELENIUM=1
  91. SKIP_UNITTESTS=1
  92. commands = {[unit_tests]commands}
  93. [testenv:integration]
  94. basepython = python3
  95. envdir = {toxworkdir}/venv
  96. # Run integration tests only
  97. passenv = AVCONV_INSTALLED
  98. setenv =
  99. PYTHONHASHSEED=0
  100. INTEGRATION_TESTS=1
  101. SELENIUM_HEADLESS=1
  102. commands = {envpython} {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --verbosity 2 --tag integration {posargs}
  103. [testenv:npm]
  104. basepython = python3
  105. passenv =
  106. HOME
  107. DISPLAY
  108. commands =
  109. nodeenv -p
  110. npm install
  111. npm run {posargs:test}
  112. [testenv:tests_system_packages]
  113. basepython = python3
  114. # Provide an environment for system packagers that dont want anything from pip
  115. # Any extra deps needed for this env can be passed by setting TOX_EXTRA_DEPS
  116. sitepackages = True
  117. passenv = TOX_EXTRA_DEPS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
  118. # Sets deps to an empty list so nothing is installed from pip
  119. deps =
  120. commands =
  121. pip install -U {env:TOX_EXTRA_DEPS:}
  122. {[unit_tests]commands}
  123. [testenv:docs]
  124. basepython = python3
  125. # We need to install horizon dependecies to build module references
  126. deps =
  127. -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
  128. -r{toxinidir}/requirements.txt
  129. -r{toxinidir}/doc/requirements.txt
  130. commands =
  131. sphinx-build -W -b html doc/source doc/build/html
  132. [testenv:releasenotes]
  133. basepython = python3
  134. envdir = {toxworkdir}/docs
  135. deps = {[testenv:docs]deps}
  136. commands =
  137. sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  138. [testenv:manage]
  139. basepython = python3
  140. envdir = {toxworkdir}/venv
  141. commands = {envpython} {toxinidir}/manage.py {posargs}
  142. [testenv:runserver]
  143. basepython = python3
  144. envdir = {toxworkdir}/venv
  145. commands = {envpython} {toxinidir}/manage.py runserver {posargs}
  146. [testenv:bandit]
  147. basepython = python3
  148. envdir = {toxworkdir}/venv
  149. commands = bandit -r horizon openstack_auth openstack_dashboard -n5 -x tests -ll
  150. [testenv:bandit-baseline]
  151. envdir = {toxworkdir}/venv
  152. basepython = python3
  153. commands = bandit-baseline -r horizon openstack_auth openstack_dashboard -n5 -x tests -ii -ll
  154. [flake8]
  155. filename = *.py,django.wsgi
  156. exclude = .git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,node_modules,openstack_dashboard/enabled/*
  157. # W504 line break after binary operator
  158. # (W503 and W504 are incompatible and we need to choose one of them.
  159. # Existing codes follows W503, so we disable W504.)
  160. # F405 TEMPLATES may be undefined, or defined from star imports
  161. # (because it is not easy to avoid this in openstack_dashboard.test.settings)
  162. ignore = W504,F405
  163. # Enable the following hacking rules which are disabled by default
  164. # H106 Do not put vim configuration in source files.
  165. # H203 Use assertIs(Not)None to check for None.
  166. # H204 Use assert(Not)Equal to check for equality.
  167. # H205 Use assert(Greater|Less)(Equal) for comparison.
  168. # H904 Delay string interpolations at logging calls.
  169. enable-extensions=H106,H203,H204,H205,H904
  170. max-complexity = 20
  171. max_line_length = 80
  172. # flake8-import-order configurations
  173. import-order-style = pep8
  174. application-import-names = horizon,openstack_dashboard
  175. [hacking]
  176. local-check-factory = horizon.hacking.checks.factory
  177. [doc8]
  178. # File extensions to check
  179. extensions = .rst, .yaml
  180. # Maximal line length should be 80 but we have some overlong lines.
  181. # Let's not get far more in.
  182. max-line-length = 80
  183. # Disable some doc8 checks:
  184. # D000: Check RST validity
  185. # - cannot handle "none" for code-block directive
  186. ignore = D000