The Gatekeeper, or a project gating system
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.
 
 
 

110 lines
2.9 KiB

  1. [tox]
  2. minversion = 3.2
  3. skipsdist = True
  4. envlist = linters,py3{-docker}
  5. ignore_basepython_conflict = True
  6. # TODO(stephenfin): It would be good to set 'requires = tox-docker', but doing
  7. # so borks the tools/pip.sh wrapper we're using here and probably isn't what
  8. # we want in the gate :(
  9. [testenv]
  10. basepython = python3
  11. install_command = bash tools/pip.sh {opts} {packages}
  12. setenv =
  13. VIRTUAL_ENV={envdir}
  14. OS_TEST_TIMEOUT=360
  15. OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:1}
  16. OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:1}
  17. OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:1}
  18. passenv =
  19. DOCKER_*
  20. NODEPOOL_ZK_HOST
  21. OS_LOG_CAPTURE
  22. OS_LOG_DEFAULTS
  23. OS_STDERR_CAPTURE
  24. OS_STDOUT_CAPTURE
  25. YARN_REGISTRY
  26. ZUUL_MYSQL_HOST
  27. ZUUL_POSTGRES_HOST
  28. ZUUL_TEST_ROOT
  29. usedevelop = True
  30. whitelist_externals = bash
  31. deps =
  32. -r{toxinidir}/requirements.txt
  33. -r{toxinidir}/test-requirements.txt
  34. docker =
  35. docker: zookeeper:3.4
  36. commands =
  37. bash -c 'stestr run --slowest --concurrency=`python -c "import multiprocessing; print(int(multiprocessing.cpu_count()/2))"` {posargs}'
  38. [testenv:bindep]
  39. # Do not install any requirements. We want this to be fast and work even if
  40. # system dependencies are missing, since it's used to tell you what system
  41. # dependencies are missing! This also means that bindep must be installed
  42. # separately, outside of the requirements files.
  43. usedevelop = False
  44. install_command = pip install {opts} {packages}
  45. deps = bindep
  46. commands = bindep test
  47. [testenv:linters]
  48. usedevelop = False
  49. install_command = pip install {opts} {packages}
  50. # --ignore-missing-imports tells mypy to not try to follow imported modules
  51. # out of the current tree. As you might expect, we don't want to run static
  52. # type checking on the world - just on ourselves.
  53. deps =
  54. flake8
  55. mypy<0.740
  56. openapi-spec-validator
  57. commands =
  58. flake8 {posargs}
  59. mypy --ignore-missing-imports zuul
  60. openapi-spec-validator web/public/openapi.yaml
  61. [testenv:cover]
  62. setenv =
  63. {[testenv]setenv}
  64. PYTHON=coverage run --source zuul --parallel-mode
  65. commands =
  66. stestr run {posargs}
  67. coverage combine
  68. coverage html -d cover
  69. coverage xml -o cover/coverage.xml
  70. [testenv:docs]
  71. install_command = pip install {opts} {packages}
  72. deps =
  73. -r{toxinidir}/doc/requirements.txt
  74. -r{toxinidir}/test-requirements.txt
  75. commands =
  76. sphinx-build -E -W -d doc/build/doctrees -b html doc/source/ doc/build/html
  77. [testenv:venv]
  78. commands = {posargs}
  79. [testenv:nodepool]
  80. commands =
  81. stestr run --concurrency=1 --test-path ./tests/nodepool {posargs}
  82. [testenv:remote]
  83. passenv =
  84. DOCKER_*
  85. NODEPOOL_ZK_HOST
  86. OS_LOG_CAPTURE
  87. OS_LOG_DEFAULTS
  88. OS_STDERR_CAPTURE
  89. OS_STDOUT_CAPTURE
  90. ZUUL_REMOTE_IPV4
  91. ZUUL_SSH_KEY
  92. ZUUL_TEST_ROOT
  93. commands =
  94. stestr run --test-path ./tests/remote {posargs}
  95. [flake8]
  96. # These are ignored intentionally in zuul projects;
  97. # please don't submit patches that solely correct them or enable them.
  98. ignore = E124,E125,E129,E252,E402,E741,H,W503,W504
  99. show-source = True
  100. exclude = .venv,.tox,dist,doc,build,*.egg,node_modules