Make all tox targets constrained

Since lbaas gate has not switched to -constraints targets yet, we can
remove them right away.

Note: override install_command for releasenotes and cover targets since
corresponding gate jobs do not provide constraints file yet.

Change-Id: If3c143153d0a09378092791e76f1a728fb978aed
This commit is contained in:
Ihar Hrachyshka 2016-03-04 13:26:43 +01:00
parent d3386d3e97
commit aa47f23690
2 changed files with 13 additions and 35 deletions

View File

@ -19,13 +19,14 @@ neutron_installed=$(echo "import neutron" | python 2>/dev/null ; echo $?)
set -e
install_cmd="pip install"
if [ "$1" = "constrained" ]; then
install_cmd="$install_cmd $2"
shift
fi
CONSTRAINTS_FILE=$1
shift
install_cmd="pip install"
if [ $CONSTRAINTS_FILE != "unconstrained" ]; then
install_cmd="$install_cmd -c$CONSTRAINTS_FILE"
fi
if [ $neutron_installed -eq 0 ]; then
echo "ALREADY INSTALLED" > /tmp/tox_install.txt
echo "Neutron already installed; using existing package"

37
tox.ini
View File

@ -7,8 +7,7 @@ skipsdist = True
setenv = VIRTUAL_ENV={envdir}
usedevelop = True
install_command =
constraints: {[testenv:common-constraints]install_command}
{toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
{toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = sh
commands =
@ -16,10 +15,9 @@ commands =
# there is also secret magic in pretty_tox.sh which lets you run in a fail only
# mode. To do this define the TRACE_FAILONLY environmental variable.
[testenv:common-constraints]
install_command = {toxinidir}/tools/tox_install.sh constrained -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
[testenv:releasenotes]
# TODO(ihrachys): remove once infra supports constraints for this target
install_command = {toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8]
@ -30,48 +28,27 @@ commands =
{[testenv:genconfig]commands}
whitelist_externals = sh
[testenv:pep8-constraints]
install_command = {[testenv:common-constraints]install_command}
commands =
flake8
# pylint --rcfile=.pylintrc --output-format=colorized {posargs:neutron_lbaas}
neutron-db-manage --subproject neutron-lbaas --config-file neutron_lbaas/tests/etc/neutron.conf check_migration
whitelist_externals = {[testenv:pep8]whitelist_externals}
[testenv:i18n]
commands = python ./tools/check_i18n.py ./neutron_lbaas ./tools/i18n_cfg.py
[testenv:cover]
commands =
python setup.py testr --coverage --coverage-package-name=neutron_lbaas --testr-args='{posargs}'
[testenv:cover-constraints]
install_command = {[testenv:common-constraints]install_command}
# TODO(ihrachys): remove once infra supports constraints for this target
install_command = {toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
commands =
python setup.py testr --coverage --coverage-package-name=neutron_lbaas --testr-args='{posargs}'
[testenv:venv]
commands = {posargs}
[testenv:venv-constraints]
install_command = {[testenv:common-constraints]install_command}
# TODO(ihrachys): remove once infra supports constraints for this target
install_command = {toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
commands = {posargs}
[testenv:docs]
commands = python setup.py build_sphinx
[testenv:docs-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {[testenv:docs]commands}
[testenv:py34]
commands = python -m testtools.run \
neutron_lbaas.tests.unit.common.cert_manager.test_barbican
[testenv:py34-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {[testenv:py34]commands}
[flake8]
# E125 continuation line does not distinguish itself from next logical line
# E126 continuation line over-indented for hanging indent