Make test jobs constrained
This change updates tox.ini and tools/tox_install.sh so that we impose upper constraints on dependencies. This is done by reusing what was done in neutron-lbaas. (we also update our tools/tox_install to benefit from a few improvements that have been brought to the one in neutron-lbaas) This change also declare our test dependency on pylint in test-requirements.txt, rather than in tox.ini, so that we don't endup with a pylint version that is inconsistent with the one global-requirements would draw. Change-Id: I904286860a5b8471f5da9312ee23bdf49004f1b0 Suggested-By: Ihar Hrachyshka <ihrachys@redhat.com>
This commit is contained in:
Thomas Morin
committed by
Thomas Morin
parent
0d8a7c39d2
commit
e8c379efd7
3 changed files with 26 additions and 10 deletions
@@ -16,6 +16,7 @@ testrepository>=0.0.18
testscenarios>=0.4
testtools>=1.4.0
reno>=0.1.1 # Apache2
pylint===1.4.5
-e git+https://git.openstack.org/openstack/networking-bagpipe#egg=networking-bagpipe
-e git+https://git.openstack.org/openstack/networking-odl#egg=networking-odl
@@ -1,7 +1,5 @@
#!/bin/sh
# borrowed from neutron-lbaas/tools
# Many of neutron's repos suffer from the problem of depending on neutron,
# but it not existing on pypi.
@@ -16,29 +14,42 @@
# pip install {opts} {packages}
ZUUL_CLONER=/usr/zuul-env/bin/zuul-cloner
BRANCH_NAME=master
neutron_installed=$(echo "import neutron" | python 2>/dev/null ; echo $?)
openstack_branch=master
set -e
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"
elif [ -x "$ZUUL_CLONER" ]; then
export ZUUL_BRANCH=${ZUUL_BRANCH-$BRANCH}
echo "ZUUL CLONER" > /tmp/tox_install.txt
cwd=$(/bin/pwd)
cd /tmp
$ZUUL_CLONER --branch $openstack_branch --cache-dir \
$ZUUL_CLONER --cache-dir \
/opt/git \
--branch $BRANCH_NAME \
git://git.openstack.org \
openstack/neutron
cd openstack/neutron
pip install -e .
$install_cmd -e .
cd "$cwd"
else
echo "PIP HARDCODE" > /tmp/tox_install.txt
pip install -U -egit+https://git.openstack.org/openstack/neutron@${openstack_branch}#egg=neutron
if [ -z "$NEUTRON_PIP_LOCATION" ]; then
NEUTRON_PIP_LOCATION="git+https://git.openstack.org/openstack/neutron@$BRANCH_NAME#egg=neutron"
fi
$install_cmd -U -e ${NEUTRON_PIP_LOCATION}
fi
pip install -U $*
$install_cmd -U $*
exit $?
10
tox.ini
10
tox.ini
@@ -5,7 +5,7 @@ skipsdist = True
[testenv]
usedevelop = True
install_command = {toxinidir}/tools/tox_install.sh {opts} {packages}
install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
@@ -13,13 +13,13 @@ deps = -r{toxinidir}/requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
[testenv:releasenotes]
# TODO(tmorin): remove once infra supports constraints for this target
install_command = {toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
commands = sphinx-build -W -a -E -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:pep8]
deps =
{[testenv]deps}
pylint
astroid
commands =
flake8
pylint --version
@@ -27,9 +27,13 @@ commands =
neutron-db-manage --subproject networking-bgpvpn --database-connection sqlite:// check_migration
[testenv:venv]
# TODO(tmorin): remove once infra supports constraints for this target
install_command = {toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
commands = {posargs}
[testenv:cover]
# TODO(tmorin): remove once infra supports constraints for this target
install_command = {toxinidir}/tools/tox_install.sh unconstrained {opts} {packages}
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:docs]
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.