OpenStack Storage (Swift)
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.

167 lines
4.8KB

  1. [tox]
  2. envlist = py37,py27,pep8
  3. minversion = 2.3.2
  4. skipsdist = True
  5. [testenv]
  6. usedevelop = True
  7. install_command = pip install -U {opts} {packages}
  8. setenv = VIRTUAL_ENV={envdir}
  9. NOSE_WITH_COVERAGE=1
  10. NOSE_COVER_BRANCHES=1
  11. NOSE_COVER_HTML_DIR={toxinidir}/cover
  12. deps =
  13. -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
  14. -r{toxinidir}/requirements.txt
  15. -r{toxinidir}/test-requirements.txt
  16. commands = find {envdir} ( -type f -o -type l ) -name "*.py[co]" -delete
  17. find {envdir} -type d -name "__pycache__" -delete
  18. nosetests {posargs:test/unit}
  19. whitelist_externals = find
  20. rm
  21. passenv = SWIFT_* *_proxy
  22. [testenv:cover]
  23. setenv = VIRTUAL_ENV={envdir}
  24. NOSE_WITH_COVERAGE=1
  25. NOSE_COVER_BRANCHES=1
  26. NOSE_COVER_HTML=1
  27. NOSE_COVER_HTML_DIR={toxinidir}/cover
  28. [testenv:pep8]
  29. basepython = python2.7
  30. commands =
  31. flake8 {posargs:swift test doc setup.py}
  32. flake8 --filename=swift* bin
  33. python ./setup.py check --restructuredtext --strict
  34. bandit -c bandit.yaml -r swift -n 5
  35. ./.manpages {posargs}
  36. [testenv:py3pep8]
  37. basepython = python3
  38. commands = {[testenv:pep8]commands}
  39. [testenv:func-py3]
  40. basepython = python3
  41. commands = ./.functests {posargs}
  42. [testenv:func-ec-py3]
  43. basepython = python3
  44. commands = ./.functests {posargs}
  45. setenv = SWIFT_TEST_IN_PROCESS=1
  46. SWIFT_TEST_IN_PROCESS_CONF_LOADER=ec
  47. [testenv:func-s3api-py3]
  48. basepython = python3
  49. commands = ./.functests {posargs}
  50. setenv = SWIFT_TEST_IN_PROCESS=1
  51. SWIFT_TEST_IN_PROCESS_CONF_LOADER=s3api
  52. [testenv:func-encryption-py3]
  53. basepython = python3
  54. commands = ./.functests {posargs}
  55. setenv = SWIFT_TEST_IN_PROCESS=1
  56. SWIFT_TEST_IN_PROCESS_CONF_LOADER=encryption
  57. [testenv:func-domain-remap-staticweb-py3]
  58. basepython = python3
  59. commands = ./.functests {posargs}
  60. setenv = SWIFT_TEST_IN_PROCESS=1
  61. SWIFT_TEST_IN_PROCESS_CONF_LOADER=domain_remap_staticweb
  62. [testenv:func]
  63. basepython = python2.7
  64. commands = ./.functests {posargs}
  65. [testenv:func-encryption]
  66. basepython = python2.7
  67. commands = ./.functests {posargs}
  68. setenv = SWIFT_TEST_IN_PROCESS=1
  69. SWIFT_TEST_IN_PROCESS_CONF_LOADER=encryption
  70. [testenv:func-domain-remap-staticweb]
  71. basepython = python2.7
  72. commands = ./.functests {posargs}
  73. setenv = SWIFT_TEST_IN_PROCESS=1
  74. SWIFT_TEST_IN_PROCESS_CONF_LOADER=domain_remap_staticweb
  75. [testenv:func-ec]
  76. basepython = python2.7
  77. commands = ./.functests {posargs}
  78. setenv = SWIFT_TEST_IN_PROCESS=1
  79. SWIFT_TEST_IN_PROCESS_CONF_LOADER=ec
  80. [testenv:func-s3api]
  81. basepython = python2.7
  82. commands = ./.functests {posargs}
  83. setenv = SWIFT_TEST_IN_PROCESS=1
  84. SWIFT_TEST_IN_PROCESS_CONF_LOADER=s3api
  85. [testenv:venv]
  86. commands = {posargs}
  87. [testenv:docs]
  88. basepython = python3
  89. deps = -r{toxinidir}/doc/requirements.txt
  90. commands = sphinx-build -W -b html doc/source doc/build/html
  91. [testenv:api-ref]
  92. # This environment is called from CI scripts to test and publish
  93. # the API Ref to docs.openstack.org.
  94. basepython = python3
  95. deps = -r{toxinidir}/doc/requirements.txt
  96. commands =
  97. rm -rf api-ref/build
  98. sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
  99. [testenv:bandit]
  100. deps = -r{toxinidir}/test-requirements.txt
  101. commands = bandit -c bandit.yaml -r swift -n 5
  102. [flake8]
  103. # it's not a bug that we aren't using all of hacking, ignore:
  104. # H101: Use TODO(NAME)
  105. # H202: assertRaises Exception too broad
  106. # H301: one import per line
  107. # H306: imports not in alphabetical order (time, os)
  108. # H404: multi line docstring should start without a leading new line
  109. # H405: multi line docstring summary not separated with an empty line
  110. # H501: Do not use self.__dict__ for string formatting
  111. ignore = H101,H202,H301,H306,H404,H405,H501
  112. exclude = .venv,.tox,dist,*egg
  113. filename = *.py,bin/*
  114. show-source = True
  115. [testenv:bindep]
  116. # Do not install any requirements. We want this to be fast and work even if
  117. # system dependencies are missing, since it's used to tell you what system
  118. # dependencies are missing! This also means that bindep must be installed
  119. # separately, outside of the requirements files.
  120. skip_install = True
  121. deps = bindep
  122. commands = bindep test
  123. [testenv:releasenotes]
  124. basepython = python3
  125. deps = -r{toxinidir}/doc/requirements.txt
  126. commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
  127. [testenv:lower-constraints]
  128. # FIXME(dhellmann): We'll want to uncomment this
  129. # when the full test suite works with python 3.
  130. # basepython = python3
  131. basepython = python2.7
  132. deps =
  133. -c{toxinidir}/lower-constraints.txt
  134. -r{toxinidir}/test-requirements.txt
  135. -r{toxinidir}/requirements.txt
  136. [testenv:pdf-docs]
  137. basepython = python3
  138. deps = {[testenv:docs]deps}
  139. whitelist_externals =
  140. make
  141. commands =
  142. sphinx-build -W -b latex doc/source doc/build/pdf
  143. make -C doc/build/pdf