Teach run-tox-api-ref.sh to install requirements with constraints

In trying to add constraints support to os-api-ref we hit a case where
installing os-api-ref with this script will also update requirements.

If a requirement isn't blocked in thw gate *or* os-api-ref hasn't merged the
proposal-bit's update this can lead to failures.

This change addresses that by installing openstack-requirements and
removing os-api-ref from upper-constraints.txt.  Then when it installs
os-api-ref the version from git is appropriate BUT all requirements are
also constrained.

Note: This assumes running in the gate and that the git setup has copied
the upper-constraints.txt into a local file and set the
UPPER_CONSTRAINTS_FILE appropriately.  The new commands will fail and
cause job failures if these pre-conditions are not met.

Change-Id: Ic9b49dbd2b9b8c991fa6d21545460ce015bcc320
Needed-By: I7ad1c2afda29b095ff3d53db5eec7101f8816c2e
This commit is contained in:
Tony Breeds
2016-12-22 19:34:27 +11:00
parent c5af70772a
commit b7ea9c81b4

View File

@@ -15,10 +15,18 @@ api_ref_dir=${1:-./os-api-ref}
script_path=/usr/local/jenkins/slave_scripts
# NOTE(tonyb): This assumes running in the gate and that the git setup has
# copied the upper-constraints.txt into a local file and set the
# UPPER_CONSTRAINTS_FILE appropriately. The new commands will fail and cause
# job failures if these pre-conditions are not met.
cat <<EOF >> tox.ini
[testenv:api-ref-src]
deps =
{[testenv]deps}
openstack-requirements
commands =
pip install -U $api_ref_dir
edit-constraints {env:UPPER_CONSTRAINTS_FILE:} -- os-api-ref
pip install -c {env:UPPER_CONSTRAINTS_FILE:} $api_ref_dir
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
EOF