
expand_dependencies() was a public interface so we should try and preserve backwards compat. However, since the interface is really broken, add a new exported function "get_elements" that instack can switch to. This returns the canonical list of elements without duplicates, and gives the path to each element too. This highlighted that the unit tests were really a bit wrong. They're testing inner functions when we have an "API" in the get_elements() function. Convert all unit-tests to use this function instead. Since this is a library call, convert the sys.exit() calls to raised exceptions. Refactor the variable output into a separate function so we can do a sanity check on it. The added flake8 ignores are for the "over-indented for ... indent" which happens a lot with these new longer lines. Most other projects ignore them. This is an alternative proposal to I15609389c18adf3017220fc94552514d195b323a Change-Id: If97bcd21e45de1b5ed91023fdc441a4617051a6b
41 lines
1.2 KiB
INI
41 lines
1.2 KiB
INI
[tox]
|
|
envlist = py34,py27,pep8
|
|
minversion = 1.6
|
|
skipsdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command = pip install -U {opts} {packages}
|
|
deps= -r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/test-requirements.txt
|
|
commands=
|
|
python setup.py testr --slowest --testr-args='{posargs}'
|
|
passenv = ELEMENTS_PATH DIB_RELEASE DIB_DEBUG_TRACE DIB_DEV_USER_USERNAME DIB_DEV_USER_PWDLESS_SUDO DIB_DEV_USER_PASSWORD USER HOME http_proxy https_proxy
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
flake8 {posargs}
|
|
dib-lint
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:func]
|
|
envdir = {toxworkdir}/venv
|
|
commands = {toxinidir}/tests/run_functests.sh {posargs}
|
|
|
|
[testenv:cover]
|
|
setenv = PYTHON=coverage run --source diskimage_builder
|
|
commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi'
|
|
bash -c 'testr run --parallel ; RET=$? ; coverage combine ; coverage html -d ./cover $OMIT && exit $RET'
|
|
|
|
[testenv:docs]
|
|
commands = python setup.py build_sphinx
|
|
|
|
[testenv:releasenotes]
|
|
commands = sphinx-build -a -W -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
|
|
|
|
[flake8]
|
|
ignore = E126,E127,E125,H202,H302,H803
|
|
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build,conf.py
|