Use constraints on all targets.

The neutron-vpnaas repo already has converted to using constraints for
targets. However, the TC recommendation is to use constraints on the
original job names (pep8, py27,...), instead of using the constrained
names (e.g. pep8-constraints).

A separate commit (I34f0b355703fe0133f160afd4e32f2272d41ecaa) restored
the use of the non-constraint NAMED jobs for Liberty and newer.

This commit modifies those non-constraints targets so that they use
constraints. A manual check was made that each target used the same
package versions for both constraints and non-constraints targets.

Then, after both constraints and non-constraints jobs passed in Jenkins
(before and after the project-config commit was upstreamed), the constraints
based targets were removed from tox.ini.

Note: Found out that infra doesn't support constraints based cover and
releasenotes. Added TODO to these targets so that they can be updated,
if and when constraints are supported.

Note: In the gate hook, config_for_vpn_func_testing.sh calls Neutron's
config_for_func_testing.sh, which will setup files in the venv. To prevent
that script from modifying the VENV variable to have -constraints suffix
and store files in the wrong venv, we turn off USE_CONSTRAINT_ENV, prior
to calling the Neutron script.

Once this is upstreamed, we can backport this fix to Liberty to complete
the effort for this repo.

Change-Id: I4a2410ab80e6018f1b65b2288ae66312eb49cb27
Depends-On: I34f0b355703fe0133f160afd4e32f2272d41ecaa
Partial-Bug: #1522503
This commit is contained in:
Paul Michali 2016-02-16 15:45:54 -05:00
parent 0fa8cbee34
commit 73a6ad9a13
3 changed files with 8 additions and 52 deletions

View File

@ -16,7 +16,7 @@ case $VENV in
NEUTRON_VPN_PATH=$GATE_DEST/$PROJECT_NAME
DEVSTACK_PATH=$GATE_DEST/devstack
IS_GATE=True
USE_CONSTRAINT_ENV=True
USE_CONSTRAINT_ENV=False
source $NEUTRON_VPN_PATH/tools/configure_for_vpn_func_testing.sh

View File

@ -37,8 +37,6 @@ esac
cd $NEUTRON_VPNAAS_DIR
sudo chown -R $owner:stack $NEUTRON_VPNAAS_DIR
# For gate, run all tests using constraints
VENV=$VENV-constraints
echo "Running neutron $VENV test suite"
set +e
sudo -H -u $owner $sudo_env tox -e $VENV

56
tox.ini
View File

@ -6,9 +6,7 @@ skipsdist = True
[testenv]
setenv = VIRTUAL_ENV={envdir}
usedevelop = True
install_command =
constraints: {[testenv:common-constraints]install_command}
{toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
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}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
whitelist_externals = sh
@ -17,9 +15,6 @@ commands =
# there is also secret magic in ostestr 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]
deps =
{[testenv]deps}
@ -52,16 +47,6 @@ setenv =
OS_TESTR_CONCURRENCY=1
TEMPEST_CONFIG_DIR={env:TEMPEST_CONFIG_DIR:/opt/stack/tempest/etc}
[testenv:dsvm-functional-constraints]
setenv = {[testenv:dsvm-functional]setenv}
deps = {[testenv:functional]deps}
sitepackages=True
install_command = {[testenv:common-constraints]install_command}
whitelist_externals = {[testenv:functional]whitelist_externals}
commands =
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}
sh tools/pretty_tox.sh '{posargs}'
[testenv:dsvm-functional-sswan]
setenv =
OS_TEST_PATH=./neutron_vpnaas/tests/functional/strongswan
@ -73,17 +58,10 @@ commands =
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}
sh tools/pretty_tox.sh '{posargs}'
[testenv:dsvm-functional-sswan-constraints]
setenv = {[testenv:dsvm-functional-sswan]setenv}
deps = {[testenv:functional]deps}
sitepackages=True
install_command = {[testenv:common-constraints]install_command}
whitelist_externals = {[testenv:functional]whitelist_externals}
commands =
{toxinidir}/tools/deploy_rootwrap.sh {toxinidir} {envdir}
sh tools/pretty_tox.sh '{posargs}'
[testenv:releasenotes]
# TODO(pc_m): Remove install_command, 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]
@ -95,42 +73,22 @@ 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_vpnaas}
{toxinidir}/tools/check_unit_test_structure.sh
neutron-db-manage --subproject neutron-vpnaas --database-connection sqlite:// check_migration
{[testenv:genconfig]commands}
whitelist_externals = sh
[testenv:i18n]
commands = python ./tools/check_i18n.py ./neutron-vpnaas ./tools/i18n_cfg.py
[testenv:cover]
commands =
python setup.py test --coverage --coverage-package-name=neutron_vpnaas --testr-args='{posargs}'
[testenv:cover-constraints]
install_command = {[testenv:common-constraints]install_command}
# TODO(pc_m): Remove install_command, 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_vpnaas --testr-args='{posargs}'
[testenv:venv]
commands = {posargs}
[testenv:venv-constraints]
install_command = {[testenv:common-constraints]install_command}
commands = {posargs}
[testenv:docs]
commands = sphinx-build -W -b html doc/source doc/build
[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