X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=tox.ini;h=01622845863b71fedd0b17f68ed8dd5e12652dbc;hb=496777fc241939e9d9f1c592a94e24df621c0f2b;hp=54ca1fefb77f17215ba47ccc42aa95ff3ea2d059;hpb=0949884ab431a16dc1841118e13c0b893fa11b85;p=yardstick.git diff --git a/tox.ini b/tox.ini index 54ca1fefb..016228458 100644 --- a/tox.ini +++ b/tox.ini @@ -1,30 +1,60 @@ [tox] minversion = 2.0 skipsdist = True -envlist = py27,py3 +envlist = py{27,3},pep8,functional{,-py3},coverage [testenv] usedevelop=True -passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY -deps = -rrequirements.txt -commands = /bin/bash ./run_tests.sh +passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY BRANCH +setenv = + VIRTUAL_ENV={envdir} +deps = + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt whitelist_externals = /bin/bash - [testenv:py27] -# don't re-run coverage on both py27 py3, it takes too long -setenv = - SKIP_COVERAGE=1 - -[flake8] -# E125 is deliberately excluded. See https://github.com/jcrocholl/pep8/issues/126 -# The rest of the ignores are TODOs -# New from hacking 0.9: E129, E131, H407, H405 -# E251 Skipped due to https://github.com/jcrocholl/pep8/issues/301 - -# nova flake8 ignores -#ignore = E121,E122,E123,E124,E125,E126,E127,E128,E129,E131,E251,H405 -# dovetail flake8 ignores -ignore = E123,E125,H803 -max-line-length = 99 -exclude = .venv,.git,.tox,dist,docs,*egg,build +commands = + /bin/bash {toxinidir}/tools/run_tests.sh --unit + +[testenv:py3] +basepython = python3 +commands = {[testenv:py27]commands} + +[testenv:pep8] +# for gate testing, scans only the files changed in the last commit +commands = + /bin/bash tools/coding-checks.sh --pylint HEAD~ '{posargs}' + +[testenv:pep8-full] +# For manual testing, scans the whole codebase +commands = + /bin/bash tools/coding-checks.sh --pylint '{posargs}' + +[testenv:coverage] +basepython = python3 +commands = + /bin/bash {toxinidir}/tools/run_tests.sh --coverage + +[testenv:functional] +commands = + /bin/bash {toxinidir}/tools/run_tests.sh --functional + +[testenv:functional-py3] +basepython = python3 +commands = {[testenv:functional]commands} + +[testenv:docs] +deps = -rdocs/requirements.txt +commands = + sphinx-build -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html + echo "Generated docs available in {toxinidir}/docs/_build/html" +whitelist_externals = echo + +[testenv:docs-linkcheck] +deps = -rdocs/requirements.txt +commands = sphinx-build -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck + +[testenv:os-requirements] +commands = + python {toxinidir}/tools/os-requirements-check.py {envdir}