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 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. [tox]
  2. envlist = pep8,py27dj{18,19,110},py35,releasenotes,npm
  3. minversion = 2.3.2
  4. skipsdist = True
  5. [testenv]
  6. install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
  7. setenv =
  8. VIRTUAL_ENV={envdir}
  9. INTEGRATION_TESTS=0
  10. NOSE_WITH_OPENSTACK=1
  11. NOSE_OPENSTACK_SHOW_ELAPSED=1
  12. whitelist_externals =
  13. bash
  14. find
  15. deps = .[test]
  16. -r{toxinidir}/requirements.txt
  17. -r{toxinidir}/test-requirements.txt
  18. commands =
  19. horizon: {envpython} {toxinidir}/manage.py test --settings=horizon.test.settings {posargs}
  20. manage: {envpython} {toxinidir}/manage.py {posargs}
  21. py27: {[unit_tests]commands}
  22. py35: {[unit_tests]commands}
  23. openstack_dashboard: {envpython} {toxinidir}/manage.py test --settings=openstack_dashboard.test.settings {posargs}
  24. runserver: {envpython} {toxinidir}/manage.py runserver {posargs}
  25. venv: {posargs}
  26. [testenv:py35]
  27. setenv =
  28. PYTHONUNBUFFERED = 1
  29. {[testenv]setenv}
  30. commands = {[unit_tests]commands}
  31. [testenv:py27dj18]
  32. commands =
  33. pip install -U django>=1.8,<1.9
  34. {[unit_tests]commands}
  35. [testenv:py27dj19]
  36. commands =
  37. pip install -U django>=1.9,<1.10
  38. {[unit_tests]commands}
  39. [testenv:py27dj110]
  40. commands =
  41. pip install -U django>=1.10,<1.11
  42. {[unit_tests]commands}
  43. [testenv:py27dj111]
  44. commands =
  45. pip install -U django>=1.11,<2.0
  46. {[unit_tests]commands}
  47. [unit_tests]
  48. commands =
  49. find . -type f -name "*.pyc" -delete
  50. bash {toxinidir}/tools/unit_tests.sh {envpython} {toxinidir} {posargs}
  51. [testenv:pep8]
  52. usedevelop = True
  53. commands =
  54. {envpython} {toxinidir}/manage.py extract_messages --verbosity 0 --check-only
  55. flake8
  56. [testenv:cover]
  57. commands =
  58. coverage erase
  59. coverage run {toxinidir}/manage.py test horizon --settings=horizon.test.settings {posargs}
  60. coverage run -a {toxinidir}/manage.py test openstack_dashboard --settings=openstack_dashboard.test.settings --exclude-dir=openstack_dashboard/test/integration_tests {posargs}
  61. coverage xml
  62. coverage html
  63. [testenv:selenium]
  64. setenv =
  65. {[testenv]setenv}
  66. WITH_SELENIUM=1
  67. SKIP_UNITTESTS=1
  68. commands = {[unit_tests]commands}
  69. [testenv:selenium-headless]
  70. setenv =
  71. {[testenv]setenv}
  72. SELENIUM_HEADLESS=1
  73. WITH_SELENIUM=1
  74. SKIP_UNITTESTS=1
  75. commands = {[unit_tests]commands}
  76. [testenv:selenium-phantomjs]
  77. setenv =
  78. {[testenv]setenv}
  79. SELENIUM_PHANTOMJS=1
  80. WITH_SELENIUM=1
  81. SKIP_UNITTESTS=1
  82. commands = {[unit_tests]commands}
  83. [testenv:py27integration]
  84. # Run integration tests only
  85. passenv = AVCONV_INSTALLED
  86. setenv =
  87. PYTHONHASHSEED=0
  88. INTEGRATION_TESTS=1
  89. SELENIUM_HEADLESS=1
  90. NOSE_WITH_OPENSTACK=1
  91. NOSE_OPENSTACK_SHOW_ELAPSED=1
  92. basepython = python2.7
  93. commands = nosetests openstack_dashboard.test.integration_tests {posargs}
  94. [testenv:npm]
  95. passenv =
  96. HOME
  97. DISPLAY
  98. commands =
  99. nodeenv -p
  100. npm install
  101. npm run {posargs:test}
  102. [testenv:tests_system_packages]
  103. # Provide an environment for system packagers that dont want anything from pip
  104. # Any extra deps needed for this env can be passed by setting TOX_EXTRA_DEPS
  105. sitepackages = True
  106. passenv = TOX_EXTRA_DEPS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
  107. # Sets deps to an empty list so nothing is installed from pip
  108. deps =
  109. commands =
  110. pip install -U {env:TOX_EXTRA_DEPS:}
  111. {[unit_tests]commands}
  112. [testenv:docs]
  113. commands =
  114. doc8 doc/source
  115. sphinx-build -W -b html doc/source doc/build/html
  116. [testenv:releasenotes]
  117. commands =
  118. doc8 releasenotes/source releasenotes/notes
  119. sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  120. [flake8]
  121. exclude = .venv,.git,.tox,dist,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject,node_modules,openstack_dashboard/enabled/*
  122. ignore =
  123. # Enable the following hacking rules which are disabled by default
  124. # H203 Use assertIs(Not)None to check for None
  125. # H904 Delay string interpolations at logging calls
  126. enable-extensions=H203,H904
  127. max-complexity = 20
  128. # flake8-import-order configurations
  129. import-order-style = pep8
  130. application-import-names = horizon,openstack_dashboard
  131. [hacking]
  132. local-check-factory = horizon.hacking.checks.factory
  133. [doc8]
  134. # File extensions to check
  135. extensions = .rst, .yaml
  136. # Maximal line length should be 80 but we have some overlong lines.
  137. # Let's not get far more in.
  138. max-line-length = 80
  139. # Disable some doc8 checks:
  140. # D000: Check RST validity
  141. # - cannot handle "none" for code-block directive
  142. ignore = D000