Add a variable to configure the Tempest venv upper constraints
We use Tempest master for testing the supported stable branches so using master upper constraints works fine but when we need to use old Tempest in the below cases then master upper constraints do not work and devstack will not be able to install Tempest in vnenv: - Testing Extended Maintenance branch - Testing py2.7 jobs until stable/train with in-tree tempest plugins This commit adds a variable to set the compatible upper constraint to use for Tempest's old version. Few of the current failure which can be fixed by this new configurable var: - networking-generic-switch-tempest-dlm-python2 - https://zuul.opendev.org/t/openstack/build/ebcf3d68d62c4af3a43a222aa9ce5556 - devstack-platform-xenial on stable/steinand stable/train - https://zuul.opendev.org/t/openstack/build/37ffc1af6f3f4b44b5ca8cbfa27068ac Change-Id: I5b2217d85e6871ca3f7a3f6f859fdce9a50d3946 (cherry picked from commit3bdc8f66ad) (cherry picked from commit2e4b708e25) (cherry picked from commit74a136ac98)
This commit is contained in:
38
lib/tempest
38
lib/tempest
@@ -110,6 +110,21 @@ function image_size_in_gib {
|
||||
echo $size | python -c "import math; import six; print(int(math.ceil(float(int(six.moves.input()) / 1024.0 ** 3))))"
|
||||
}
|
||||
|
||||
function set_tempest_venv_constraints {
|
||||
local tmp_c
|
||||
tmp_c=$1
|
||||
if [[ $TEMPEST_VENV_UPPER_CONSTRAINTS == "master" ]]; then
|
||||
(cd $REQUIREMENTS_DIR && git show origin/master:upper-constraints.txt) > $tmp_c
|
||||
else
|
||||
echo "Using $TEMPEST_VENV_UPPER_CONSTRAINTS constraints in Tempest virtual env."
|
||||
cat $TEMPEST_VENV_UPPER_CONSTRAINTS > $tmp_c
|
||||
# NOTE: setting both tox env var and once Tempest start using new var
|
||||
# TOX_CONSTRAINTS_FILE then we can remove the old one.
|
||||
export UPPER_CONSTRAINTS_FILE=$TEMPEST_VENV_UPPER_CONSTRAINTS
|
||||
export TOX_CONSTRAINTS_FILE=$TEMPEST_VENV_UPPER_CONSTRAINTS
|
||||
fi
|
||||
}
|
||||
|
||||
# configure_tempest() - Set config files, create data dirs, etc
|
||||
function configure_tempest {
|
||||
if [[ "$INSTALL_TEMPEST" == "True" ]]; then
|
||||
@@ -610,9 +625,11 @@ function configure_tempest {
|
||||
tox -revenv-tempest --notest
|
||||
fi
|
||||
|
||||
# The requirements might be on a different branch, while tempest needs master requirements.
|
||||
(cd $REQUIREMENTS_DIR && git show origin/master:upper-constraints.txt) > u-c-m.txt
|
||||
tox -evenv-tempest -- pip install -c u-c-m.txt -r requirements.txt
|
||||
local tmp_u_c_m
|
||||
tmp_u_c_m=$(mktemp -t tempest_u_c_m.XXXXXXXXXX)
|
||||
set_tempest_venv_constraints $tmp_u_c_m
|
||||
tox -evenv-tempest -- pip install -c $tmp_u_c_m -r requirements.txt
|
||||
rm -f $tmp_u_c_m
|
||||
|
||||
# Auth:
|
||||
iniset $TEMPEST_CONFIG auth tempest_roles "member"
|
||||
@@ -729,12 +746,17 @@ function install_tempest {
|
||||
# TEMPEST_DIR already exist until RECLONE is true.
|
||||
git checkout $TEMPEST_BRANCH
|
||||
|
||||
local tmp_u_c_m
|
||||
tmp_u_c_m=$(mktemp -t tempest_u_c_m.XXXXXXXXXX)
|
||||
set_tempest_venv_constraints $tmp_u_c_m
|
||||
|
||||
tox -r --notest -efull
|
||||
# NOTE(mtreinish) Respect constraints in the tempest full venv, things that
|
||||
# are using a tox job other than full will not be respecting constraints but
|
||||
# running pip install -U on tempest requirements
|
||||
$TEMPEST_DIR/.tox/tempest/bin/pip install -c $REQUIREMENTS_DIR/upper-constraints.txt -r requirements.txt
|
||||
$TEMPEST_DIR/.tox/tempest/bin/pip install -c $tmp_u_c_m -r requirements.txt
|
||||
PROJECT_VENV["tempest"]=${TEMPEST_DIR}/.tox/tempest
|
||||
rm -f $tmp_u_c_m
|
||||
popd
|
||||
}
|
||||
|
||||
@@ -742,9 +764,11 @@ function install_tempest {
|
||||
function install_tempest_plugins {
|
||||
pushd $TEMPEST_DIR
|
||||
if [[ $TEMPEST_PLUGINS != 0 ]] ; then
|
||||
# The requirements might be on a different branch, while tempest & tempest plugins needs master requirements.
|
||||
(cd $REQUIREMENTS_DIR && git show origin/master:upper-constraints.txt) > u-c-m.txt
|
||||
tox -evenv-tempest -- pip install -c u-c-m.txt $TEMPEST_PLUGINS
|
||||
local tmp_u_c_m
|
||||
tmp_u_c_m=$(mktemp -t tempest_u_c_m.XXXXXXXXXX)
|
||||
set_tempest_venv_constraints $tmp_u_c_m
|
||||
tox -evenv-tempest -- pip install -c $tmp_u_c_m $TEMPEST_PLUGINS
|
||||
rm -f $tmp_u_c_m
|
||||
echo "Checking installed Tempest plugins:"
|
||||
tox -evenv-tempest -- tempest list-plugins
|
||||
fi
|
||||
|
||||
1
stackrc
1
stackrc
@@ -315,6 +315,7 @@ REQUIREMENTS_BRANCH=${REQUIREMENTS_BRANCH:-$TARGET_BRANCH}
|
||||
# Tempest test suite
|
||||
TEMPEST_REPO=${TEMPEST_REPO:-${GIT_BASE}/openstack/tempest.git}
|
||||
TEMPEST_BRANCH=${TEMPEST_BRANCH:-$BRANCHLESS_TARGET_BRANCH}
|
||||
TEMPEST_VENV_UPPER_CONSTRAINTS=${TEMPEST_VENV_UPPER_CONSTRAINTS:-master}
|
||||
|
||||
|
||||
##############
|
||||
|
||||
Reference in New Issue
Block a user