[stable-only] Use Tempest's run upper constraints from devstack

Devstack creates the tempest virtual env with upper
constraints set by TEMPEST_VENV_UPPER_CONSTRAINTS[1].
For stable/train, they are stable/train constraints but then nova
run tempest in run_tests.sh then it does not set/pass the
upper constraints so master constraints is used and it ends up
recreating the tempest virtual env and fail the job.

We should make sure that upper constraints used in nova tempest run
and devstack is same.

- https://zuul.opendev.org/t/openstack/build/f50f83571d4348e996e175ea5aad97f7/log/job-output.txt#5100

[1] https://github.com/openstack/devstack/blob/stable/train/stackrc#L320

Change-Id: Iad2d198c58512b26dc2733b97bedeffc00108656
This commit is contained in:
Ghanshyam Mann 2022-05-20 20:17:35 -05:00 committed by Elod Illes
parent 156ce0b247
commit e21fb67934
1 changed files with 11 additions and 1 deletions

View File

@ -3,7 +3,17 @@
function run_tempest {
local message=$1
local tempest_regex=$2
sudo -H -u tempest tox -eall -- $tempest_regex --concurrency=$TEMPEST_CONCURRENCY
# NOTE(gmann): Set upper constraint for Tempest run so that it matches
# with what devstack is using and does not recreate the tempest virtual
# env.
TEMPEST_VENV_UPPER_CONSTRAINTS=$(set +o xtrace &&
source $BASE/new/devstack/stackrc &&
echo $TEMPEST_VENV_UPPER_CONSTRAINTS)
export UPPER_CONSTRAINTS_FILE=$TEMPEST_VENV_UPPER_CONSTRAINTS
echo "using $UPPER_CONSTRAINTS_FILE for tempest run"
sudo -H -u tempest UPPER_CONSTRAINTS_FILE=$UPPER_CONSTRAINTS_FILE tox -eall -- $tempest_regex --concurrency=$TEMPEST_CONCURRENCY
exitcode=$?
if [[ $exitcode -ne 0 ]]; then
die $LINENO "$message failure"