From 7fe998109bda8cdd5cb5ba4a0e02c6c83cb0566d Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Thu, 26 Jan 2023 22:28:07 -0600 Subject: [PATCH] Fix setting the tempest virtual env constraints env var Devstack set the env var TOX_CONSTRAINTS_FILE/UPPER_CONSTRAINTS_FILE which are used to use the constraints during Tempest virtual env installation. Those env var are set to non-master constraint when we need to use non-master constraints but when we need to use the master constraints we do not set/reset them point to master constraints. This create the issue when running the grenade job where we run Tempest on the old devstack as well as in the new devstack. When tempest is installed on old devstack then old tempest is used and it sets these env var to stable/ constraints (this is the case when old devstack (the stable branch is in EM phase) uses the old tempest not the master tempest), all good till now. But the problem comes when in the same grenade script run upgrade-tempest install the master tempest (when new devstack branches are in the 'supported' phase and use the master tempest means) and are supposed to use the master constraints. But the TOX_CONSTRAINTS_FILE/UPPER_CONSTRAINTS_FILE env var set by old tempest is used by the tempest and due to a mismatch in constraints it fails. This happened when we tried to pin the stable/wallaby with Tempest 29.0.0 - https://review.opendev.org/c/openstack/devstack/+/871782 and table/xena grenade job failed (stable/xena use master tempest and supposed to use master constraints) - https://zuul.opendev.org/t/openstack/build/fb7b2a8b562c42bab4c741819f5e9732/log/controller/logs/grenade.sh_log.txt#16641 We should set/reset those constraint env var to master constraints if configuration tell devstack to use the master constraints. [1] https://github.com/openstack/devstack/blob/71c3c40c269a50303247855319d1d3a5d30f6773/lib/tempest#L124 Closes-Bug: #2003993 Change-Id: I5e938139b47f443a4c358415d0d4dcf6549cd085 --- lib/tempest | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/tempest b/lib/tempest index 44a9b6f29f..c3d3e9ac30 100644 --- a/lib/tempest +++ b/lib/tempest @@ -128,6 +128,13 @@ function set_tempest_venv_constraints { (cd $REQUIREMENTS_DIR && git show master:upper-constraints.txt 2>/dev/null || git show origin/master:upper-constraints.txt) > $tmp_c + # NOTE(gmann): we need to set the below env var pointing to master + # constraints even that is what default in tox.ini. Otherwise it can + # create the issue for grenade run where old and new devstack can have + # different tempest (old and master) to install. For detail problem, + # refer to the https://bugs.launchpad.net/devstack/+bug/2003993 + export UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/master + export TOX_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/master else echo "Using $TEMPEST_VENV_UPPER_CONSTRAINTS constraints in Tempest virtual env." cat $TEMPEST_VENV_UPPER_CONSTRAINTS > $tmp_c