OpenStack Identity (Keystone)
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 5.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. [tox]
  2. minversion = 2.5.0
  3. skipsdist = True
  4. envlist = py27,py37,pep8,api-ref,docs,genconfig,genpolicy,releasenotes
  5. [testenv]
  6. usedevelop = True
  7. install_command = pip install {opts} {packages}
  8. setenv = VIRTUAL_ENV={envdir}
  9. deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  10. -r{toxinidir}/test-requirements.txt
  11. -r{toxinidir}/requirements.txt
  12. .[ldap,memcache,mongodb]
  13. commands =
  14. find keystone -type f -name "*.pyc" -delete
  15. stestr run {posargs}
  16. whitelist_externals =
  17. bash
  18. find
  19. passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY PBR_VERSION
  20. [testenv:api-ref]
  21. basepython = python3
  22. deps = -r{toxinidir}/doc/requirements.txt
  23. commands =
  24. bash -c "rm -rf api-ref/build"
  25. sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
  26. [testenv:pep8]
  27. basepython = python3
  28. deps =
  29. .[bandit]
  30. {[testenv]deps}
  31. commands =
  32. flake8 --ignore=D100,D101,D102,D103,D104,E305,E402,E501,W503,W504,W605
  33. # Run bash8 during pep8 runs to ensure violations are caught by
  34. # the check and gate queues
  35. bashate devstack/plugin.sh
  36. # Run security linter
  37. bandit -r keystone -x 'keystone/tests/*'
  38. [testenv:fast8]
  39. basepython = python3
  40. envdir = {toxworkdir}/pep8
  41. commands =
  42. {toxinidir}/tools/fast8.sh
  43. passenv = FAST8_NUM_COMMITS
  44. [testenv:bandit]
  45. basepython = python3
  46. # NOTE(browne): This is required for the integration test job of the bandit
  47. # project. Please do not remove.
  48. deps = -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  49. -r{toxinidir}/requirements.txt
  50. .[bandit]
  51. commands = bandit -r keystone -x 'keystone/tests/*'
  52. [testenv:cover]
  53. basepython = python3
  54. # Also do not run test_coverage_ext tests while gathering coverage as those
  55. # tests conflict with coverage.
  56. setenv =
  57. {[testenv]setenv}
  58. PYTHON=coverage run --source keystone --parallel-mode
  59. commands =
  60. find keystone -type f -name "*.pyc" -delete
  61. stestr run {posargs}
  62. coverage combine
  63. coverage html -d cover
  64. coverage xml -o cover/coverage.xml
  65. [testenv:patch_cover]
  66. basepython = python3
  67. commands =
  68. bash tools/cover.sh
  69. [testenv:venv]
  70. basepython = python3
  71. commands = {posargs}
  72. [testenv:debug]
  73. basepython = python3
  74. commands =
  75. find keystone -type f -name "*.pyc" -delete
  76. oslo_debug_helper {posargs}
  77. passenv =
  78. KSTEST_ADMIN_URL
  79. KSTEST_ADMIN_USERNAME
  80. KSTEST_ADMIN_PASSWORD
  81. KSTEST_ADMIN_DOMAIN_ID
  82. KSTEST_PUBLIC_URL
  83. KSTEST_USER_USERNAME
  84. KSTEST_USER_PASSWORD
  85. KSTEST_USER_DOMAIN_ID
  86. KSTEST_PROJECT_ID
  87. [testenv:functional]
  88. basepython = python3
  89. deps = -r{toxinidir}/test-requirements.txt
  90. setenv = OS_TEST_PATH=./keystone/tests/functional
  91. commands =
  92. find keystone -type f -name "*.pyc" -delete
  93. stestr run {posargs}
  94. stestr slowest
  95. passenv =
  96. KSTEST_ADMIN_URL
  97. KSTEST_ADMIN_USERNAME
  98. KSTEST_ADMIN_PASSWORD
  99. KSTEST_ADMIN_DOMAIN_ID
  100. KSTEST_PUBLIC_URL
  101. KSTEST_USER_USERNAME
  102. KSTEST_USER_PASSWORD
  103. KSTEST_USER_DOMAIN_ID
  104. KSTEST_PROJECT_ID
  105. [flake8]
  106. filename= *.py,keystone-manage
  107. show-source = true
  108. enable-extensions = H203,H904
  109. # D100: Missing docstring in public module
  110. # D101: Missing docstring in public class
  111. # D102: Missing docstring in public method
  112. # D103: Missing docstring in public function
  113. # D104: Missing docstring in public package
  114. # D203: 1 blank line required before class docstring (deprecated in pep257)
  115. # TODO(wxy): Fix the pep8 issue.
  116. # E402: module level import not at top of file
  117. # W503: line break before binary operator
  118. ignore = D100,D101,D102,D103,D104,D203,E402,W503
  119. exclude=.venv,.git,.tox,build,dist,*lib/python*,*egg,tools,vendor,.update-venv,*.ini,*.po,*.pot
  120. max-complexity=24
  121. [testenv:docs]
  122. basepython = python3
  123. deps =
  124. -r{toxinidir}/doc/requirements.txt
  125. .[ldap,memcache,mongodb]
  126. commands=
  127. bash -c "rm -rf doc/build"
  128. bash -c "rm -rf doc/source/api"
  129. sphinx-build -W -b html -d doc/build/doctrees doc/source doc/build/html
  130. # FIXME(gyee): we need to pre-create the doc/build/pdf/_static directory as a
  131. # workaround because sphinx_feature_classification.support_matrix extension
  132. # is operating under the assumption that the _static directory already exist
  133. # and trying to copy support-matrix.css into it. We need to remove
  134. # the workaround after this patch has merged:
  135. # https://review.opendev.org/#/c/679860
  136. [testenv:pdf-docs]
  137. basepython = python3
  138. envdir = {toxworkdir}/docs
  139. deps = {[testenv:docs]deps}
  140. whitelist_externals =
  141. make
  142. mkdir
  143. rm
  144. commands =
  145. rm -rf doc/build/pdf
  146. mkdir -p doc/build/pdf/_static
  147. sphinx-build -W -b latex doc/source doc/build/pdf
  148. make -C doc/build/pdf
  149. [testenv:releasenotes]
  150. basepython = python3
  151. deps = -r{toxinidir}/doc/requirements.txt
  152. commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  153. [testenv:genconfig]
  154. basepython = python3
  155. commands = oslo-config-generator --config-file=config-generator/keystone.conf
  156. [testenv:genpolicy]
  157. basepython = python3
  158. commands = oslopolicy-sample-generator --config-file config-generator/keystone-policy-generator.conf
  159. [hacking]
  160. import_exceptions =
  161. keystone.i18n
  162. six.moves
  163. local-check-factory = keystone.tests.hacking.checks.factory
  164. [testenv:bindep]
  165. basepython = python3
  166. # Do not install any requirements. We want this to be fast and work even if
  167. # system dependencies are missing, since it's used to tell you what system
  168. # dependencies are missing! This also means that bindep must be installed
  169. # separately, outside of the requirements files.
  170. deps = bindep
  171. commands = bindep test
  172. [testenv:lower-constraints]
  173. basepython = python3
  174. deps =
  175. -c{toxinidir}/lower-constraints.txt
  176. -r{toxinidir}/test-requirements.txt
  177. .[ldap,memcache,mongodb]