Tools to make Jenkins jobs from templates
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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [tox]
  2. minversion = 2.2
  3. envlist = docs, pep8, py34, py35, py36, py27, cover
  4. skip_missing_interpreters = true
  5. [testenv]
  6. setenv =
  7. LANG=en_US.UTF-8
  8. PYTHONDONTWRITEBYTECODE=1
  9. SUBUNIT_FORMATTER=tee testr_subunit_log
  10. VIRTUAL_ENV={envdir}
  11. usedevelop = True
  12. install_command = pip install {opts} {packages}
  13. deps = -r{toxinidir}/test-requirements.txt
  14. # cleanup is needed mostly for dev environmnts and assures that if dev
  15. # is switching branch, no lefovers will impact execution.
  16. # No git commands here because test should run even from a source archive.
  17. commands =
  18. - find . -type f -name "*.pyc" -delete
  19. - find . -type d -name "__pycache__" -delete
  20. # test that we can call jjb using both variants with same results
  21. bash {toxinidir}/tools/test-commands.sh
  22. stestr run --slowest {posargs}
  23. whitelist_externals =
  24. bash
  25. find
  26. [testenv:tips]
  27. # tests what happens with unreleased version of dependencies, like python-jenkins
  28. install_command = pip install -U {opts} {packages}
  29. commands =
  30. bash -c "if [ -d {toxinidir}/../python-jenkins ]; then \
  31. pip install -q -U -e 'git+file://{toxinidir}/../python-jenkins#egg=python-jenkins' ; else \
  32. pip install -q -U -e 'git+https://git.openstack.org/openstack/python-jenkins@master#egg=python-jenkins' ; fi "
  33. stestr run --slowest {posargs}
  34. [testenv:cover]
  35. setenv =
  36. {[testenv]setenv}
  37. PYTHON=coverage run --source jenkins_jobs --parallel-mode
  38. commands =
  39. stestr run {posargs}
  40. coverage combine
  41. coverage html -d cover
  42. coverage xml -o cover/coverage.xml
  43. [testenv:pep8]
  44. basepython = python3
  45. commands = flake8
  46. [testenv:pyflakes]
  47. deps = pyflakes
  48. commands = pyflakes jenkins_jobs tests setup.py
  49. [testenv:compare-xml-config]
  50. commands = jenkins-jobs {posargs:test -o .test/run-conf/default/out/ .test/run-conf/config/}
  51. [testenv:compare-xml-old]
  52. commands = jenkins-jobs test -o .test/old/out/ .test/old/config/
  53. [testenv:compare-xml-new]
  54. commands = jenkins-jobs test -o .test/new/out/ .test/new/config/
  55. [testenv:docs]
  56. commands = python setup.py build_sphinx {posargs}
  57. [testenv:docs-linkcheck]
  58. # If you are behind a proxy, for this test to work you will need to set
  59. # TOX_TESTENV_PASSENV="http_proxy https_proxy no_proxy ..." to pass
  60. # through the proxy environment settings to be able to validate any urls.
  61. commands = python setup.py build_sphinx -b linkcheck
  62. [testenv:venv]
  63. commands = {posargs}
  64. [flake8]
  65. # These are ignored intentionally in openstack-infra projects; please
  66. # don't submit patches that solely correct them or enable them.
  67. ignore = E125,E128,H
  68. show-source = True
  69. exclude = .virtualenv,.venv,.tox,dist,doc,build,*.egg,.test