diff --git a/.coveragerc b/.coveragerc index 57179f02..d8e98bbb 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,8 +1,7 @@ [run] branch = True -source = nova_lxd -omit = nova_lxd/tests/* +source = nova.virt.lxd +omit = nova/tests/* [report] ignore_errors = True -precision = 2 diff --git a/.gitignore b/.gitignore index 10412da9..7aff60eb 100644 --- a/.gitignore +++ b/.gitignore @@ -53,3 +53,5 @@ ChangeLog *~ .*.swp .*sw? + +cover diff --git a/tox.ini b/tox.ini index 43f8cef1..d63c9b29 100644 --- a/tox.ini +++ b/tox.ini @@ -1,31 +1,45 @@ [tox] -minversion = 1.6 -# Python 3 tests MUST run first, due to this bug: -# https://bugs.launchpad.net/testrepository/+bug/1229445 -envlist = py3,py27,pep8 +minversion = 2.0 +envlist = py{35,27},pep8 skipsdist = True [testenv] usedevelop = True install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} setenv = - VIRTUAL_ENV={envdir} - EVENTLET_NO_GREENDNS=yes - PYTHONDONTWRITEBYTECODE=1 + VIRTUAL_ENV={envdir} + EVENTLET_NO_GREENDNS=yes + PYTHONDONTWRITEBYTECODE=1 + LANGUAGE=en_US + LC_ALL=en_US.utf-8 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -egit+https://github.com/openstack/nova.git#egg=nova -commands = ostestr {posargs} +whitelist_externals = + bash + find + rm + env +commands = + find . -type f -name "*.pyc" -delete + rm -Rf .testrepository/times.dbm +passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY OS_DEBUG GENERATE_HASHES [testenv:py27] -commands = /bin/cp -r {toxinidir}/nova/virt/lxd/ {toxinidir}/.tox/py27/src/nova/nova/virt/ - python setup.py testr --slowest --testr-args='{posargs}' +commands = + {[testenv]commands} + /bin/cp -r {toxinidir}/nova/virt/lxd/ {toxinidir}/.tox/py27/src/nova/nova/virt/ + ostestr '{posargs}' -[testenv:py34] -commands = /bin/cp -r {toxinidir}/nova/virt/lxd/ {toxinidir}/.tox/py34/src/nova/nova/virt/ - python setup.py testr --slowest --testr-args='{posargs}' +[testenv:py35] +commands = + {[testenv]commands} + /bin/cp -r {toxinidir}/nova/virt/lxd/ {toxinidir}/.tox/py35/src/nova/nova/virt/ + ostestr '{posargs}' [testenv:pep8] +basepython = python2.7 +deps = {[testenv]deps} commands = flake8 {toxinidir}/nova [testenv:venv] @@ -34,12 +48,11 @@ commands = {posargs} [testenv:cover] # Also do not run test_coverage_ext tests while gathering coverage as those # tests conflict with coverage. -commands = - coverage erase - python setup.py testr --coverage --coverage-package-name=nova_lxd \ - --testr-args='{posargs}' - coverage combine - coverage html --include='nova_lxd/*' -d covhtml -i +commands = + coverage erase + find . -type f -name "*.pyc" -delete + python setup.py testr --coverage --testr-args='{posargs}' + coverage report [testenv:docs] commands = python setup.py build_sphinx