From db029ff867bd0c0ed4b86a33c81189fdc958b7f1 Mon Sep 17 00:00:00 2001 From: Ihar Hrachyshka Date: Fri, 4 Mar 2016 13:51:07 +0100 Subject: [PATCH] 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 --- tools/tox_install.sh | 16 ++++++---------- tox.ini | 36 +++++++----------------------------- 2 files changed, 13 insertions(+), 39 deletions(-) diff --git a/tools/tox_install.sh b/tools/tox_install.sh index 3eee61bf6..c76227ecd 100755 --- a/tools/tox_install.sh +++ b/tools/tox_install.sh @@ -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" diff --git a/tox.ini b/tox.ini index f39b36501..9fb596579 100644 --- a/tox.ini +++ b/tox.ini @@ -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