Make all tox targets constrained

Since fwaas 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:51:07 +01:00
parent fb71133c2e
commit db029ff867
2 changed files with 13 additions and 39 deletions

View File

@ -8,24 +8,20 @@
# from neutron master via a hard-coded URL. That last case should only
# happen with devs running unit tests locally.
# From the tox.ini config page:
# install_command=ARGV
# default:
# pip install {opts} {packages}
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
neutron_installed=$(echo "import neutron" | python 2>/dev/null ; echo $?)
BRANCH_NAME=master
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"

36
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}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = sh
@ -19,9 +18,6 @@ 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:functional]
setenv = OS_TEST_PATH=./neutron_fwaas/tests/functional
commands =
@ -60,6 +56,8 @@ commands =
python setup.py testr --slowest --testr-args='{posargs}'
[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]
@ -70,37 +68,23 @@ commands =
{[testenv:genconfig]commands}
whitelist_externals = sh
[testenv:pep8-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {[testenv:pep8]commands}
whitelist_externals = {[testenv:pep8]whitelist_externals}
[testenv:i18n]
commands = python ./tools/check_i18n.py ./neutron_fwaas ./tools/i18n_cfg.py
[testenv:cover]
# TODO(ihrachys): remove once infra supports constraints for this target
install_command = {toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
commands =
python setup.py test --coverage --coverage-package-name=neutron_fwaas --testr-args='{posargs}'
[testenv:cover-constraints]
commands =
install_command = {[testenv:common-constraints]install_command}
python setup.py test --coverage --coverage-package-name=neutron_fwaas --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}
[flake8]
# E125 continuation line does not distinguish itself from next logical line
# E126 continuation line over-indented for hanging indent
@ -120,12 +104,6 @@ deps =
commands =
pylint --rcfile=.pylintrc --output-format=colorized {posargs:neutron_fwaas}
[testenv:pylint-constraints]
install_command = {[testenv:common-constraints]install_command}
deps = {[testenv:pylint]deps}
commands =
pylint --rcfile=.pylintrc --output-format=colorized {posargs:neutron_fwaas}
[hacking]
import_exceptions = neutron_fwaas._i18n
local-check-factory = neutron.hacking.checks.factory