@@ -111,6 +111,21 @@ function image_size_in_gib {
111111 echo $size | python3 -c " import math; print(int(math.ceil(float(int(input()) / 1024.0 ** 3))))"
112112}
113113
114+ function set_tempest_venv_constraints {
115+ local tmp_c
116+ tmp_c=$1
117+ if [[ $TEMPEST_VENV_UPPER_CONSTRAINTS == " master" ]]; then
118+ (cd $REQUIREMENTS_DIR && git show origin/master:upper-constraints.txt) > $tmp_c
119+ else
120+ echo " Using $TEMPEST_VENV_UPPER_CONSTRAINTS constraints in Tempest virtual env."
121+ cat $TEMPEST_VENV_UPPER_CONSTRAINTS > $tmp_c
122+ # NOTE: setting both tox env var and once Tempest start using new var
123+ # TOX_CONSTRAINTS_FILE then we can remove the old one.
124+ export UPPER_CONSTRAINTS_FILE=$TEMPEST_VENV_UPPER_CONSTRAINTS
125+ export TOX_CONSTRAINTS_FILE=$TEMPEST_VENV_UPPER_CONSTRAINTS
126+ fi
127+ }
128+
114129# configure_tempest() - Set config files, create data dirs, etc
115130function configure_tempest {
116131 if [[ " $INSTALL_TEMPEST " == " True" ]]; then
@@ -613,10 +628,9 @@ function configure_tempest {
613628 tox -revenv-tempest --notest
614629 fi
615630
616- # The requirements might be on a different branch, while tempest needs master requirements.
617631 local tmp_u_c_m
618632 tmp_u_c_m=$( mktemp -t tempest_u_c_m.XXXXXXXXXX)
619- (cd $REQUIREMENTS_DIR && git show origin/master:upper-constraints.txt) > $tmp_u_c_m
633+ set_tempest_venv_constraints $tmp_u_c_m
620634 tox -evenv-tempest -- pip install -c $tmp_u_c_m -r requirements.txt
621635 rm -f $tmp_u_c_m
622636
@@ -697,26 +711,30 @@ function install_tempest {
697711 # TEMPEST_DIR already exist until RECLONE is true.
698712 git checkout $TEMPEST_BRANCH
699713
714+ local tmp_u_c_m
715+ tmp_u_c_m=$( mktemp -t tempest_u_c_m.XXXXXXXXXX)
716+ set_tempest_venv_constraints $tmp_u_c_m
717+
700718 tox -r --notest -efull
701719 # TODO: remove the trailing pip constraint when a proper fix
702720 # arrives for bug https://bugs.launchpad.net/devstack/+bug/1906322
703721 $TEMPEST_DIR /.tox/tempest/bin/pip install -U -r $RC_DIR /tools/cap-pip.txt
704722 # NOTE(mtreinish) Respect constraints in the tempest full venv, things that
705723 # are using a tox job other than full will not be respecting constraints but
706724 # running pip install -U on tempest requirements
707- $TEMPEST_DIR /.tox/tempest/bin/pip install -c $REQUIREMENTS_DIR /upper-constraints.txt -r requirements.txt
725+ $TEMPEST_DIR /.tox/tempest/bin/pip install -c $tmp_u_c_m -r requirements.txt
708726 PROJECT_VENV[" tempest" ]=${TEMPEST_DIR} /.tox/tempest
727+ rm -f $tmp_u_c_m
709728 popd
710729}
711730
712731# install_tempest_plugins() - Install any specified plugins into the tempest venv
713732function install_tempest_plugins {
714733 pushd $TEMPEST_DIR
715734 if [[ $TEMPEST_PLUGINS != 0 ]] ; then
716- # The requirements might be on a different branch, while tempest & tempest plugins needs master requirements.
717735 local tmp_u_c_m
718736 tmp_u_c_m=$( mktemp -t tempest_u_c_m.XXXXXXXXXX)
719- (cd $REQUIREMENTS_DIR && git show origin/master:upper-constraints.txt) > $tmp_u_c_m
737+ set_tempest_venv_constraints $tmp_u_c_m
720738 tox -evenv-tempest -- pip install -c $tmp_u_c_m $TEMPEST_PLUGINS
721739 rm -f $tmp_u_c_m
722740 echo " Checking installed Tempest plugins:"
0 commit comments