A declarative host provisioning 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.

tox.ini 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. [tox]
  2. envlist = py35,pep8,bandit
  3. setupdir=python/
  4. [testenv]
  5. setenv = YAMLDIR = {toxinidir}/python/tests/yaml_samples/
  6. basepython=python3
  7. passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY
  8. deps=
  9. -rpython/requirements-lock.txt
  10. -rpython/requirements-test.txt
  11. [testenv:venv]
  12. commands = {posargs}
  13. [testenv:freeze]
  14. basepython=python3
  15. recreate = True
  16. whitelist_externals=
  17. rm
  18. sh
  19. deps=
  20. -rpython/requirements-direct.txt
  21. commands=
  22. rm python/requirements-lock.txt
  23. sh -c "pip freeze --all | grep -vE 'drydock-provisioner|pyinotify|pkg-resources==0.0.0' > python/requirements-lock.txt"
  24. [testenv:yapf]
  25. basepython=python3
  26. whitelist_externals=find
  27. commands=
  28. yapf -i -r --style=pep8 {toxinidir}/python/setup.py
  29. yapf -i -r --style=pep8 {toxinidir}/alembic
  30. yapf -i -r --style=pep8 {toxinidir}/python/drydock_provisioner
  31. yapf -i -r --style=pep8 {toxinidir}/python/tests
  32. find {toxinidir}/python/drydock_provisioner -name '__init__.py' -exec yapf -i --style=pep8 \{\} ;
  33. [testenv:py35]
  34. basepython=python3
  35. usedevelop=True
  36. setenv=
  37. PYTHONWARNING=all
  38. YAMLDIR={toxinidir}/python/tests/yaml_samples/
  39. commands=
  40. py.test \
  41. --cov=drydock_provisioner \
  42. {toxinidir}/python/tests/unit/{posargs}
  43. [testenv:integration]
  44. basepython=python3.5
  45. passenv=DOCKER_REGISTRY IMAGE_NAME IMAGE_PREFIX IMAGE_TAG
  46. setenv=
  47. PYTHONWARNING=all
  48. YAMLDIR={toxinidir}/python/tests/yaml_samples/
  49. commands=
  50. {toxinidir}/python/tests/postgres/start_postgres.sh
  51. py.test \
  52. {toxinidir}/python/tests/integration/postgres/{posargs}
  53. [testenv:cover]
  54. basepython=python3
  55. usedevelop=True
  56. passenv=DOCKER_REGISTRY IMAGE_NAME IMAGE_PREFIX IMAGE_TAG
  57. setenv=
  58. YAMLDIR={toxinidir}/python/tests/yaml_samples/
  59. commands=
  60. {toxinidir}/python/tests/postgres/start_postgres.sh
  61. py.test --cov=drydock_provisioner \
  62. {toxinidir}/python/tests/unit/ {toxinidir}/python/tests/integration/postgres
  63. [testenv:genconfig]
  64. basepython=python3
  65. whitelist_externals=tee
  66. sh
  67. commands = sh -c 'oslo-config-generator --config-file=etc/drydock/drydock-config-generator.conf | tee etc/drydock/drydock.conf.sample docs/source/_static/drydock.conf.sample'
  68. [testenv:genpolicy]
  69. basepython=python3
  70. whitelist_externals=tee
  71. sh
  72. commands = sh -c 'oslopolicy-sample-generator --config-file etc/drydock/drydock-policy-generator.conf | tee etc/drydock/policy.yaml.sample docs/source/_static/policy.yaml.sample'
  73. [testenv:pep8]
  74. basepython=python3
  75. commands = flake8 \
  76. {posargs}
  77. [testenv:bandit]
  78. basepython=python3
  79. commands = bandit -r drydock_provisioner -n 5
  80. [flake8]
  81. ignore=E302,H306,H304,W503,E251,E126
  82. exclude= venv,.venv,.git,.idea,.tox,*.egg-info,*.eggs,bin,dist,./build/,alembic/
  83. max-line-length=119
  84. [testenv:docs]
  85. basepython=python3
  86. deps=
  87. -rdocs/requirements-doc.txt
  88. whitelist_externals=rm
  89. recreate=true
  90. commands =
  91. rm -rf docs/build
  92. sphinx-build -b html docs/source docs/build