From 8f7941259651e59320ffd29563e40c2d71b05a1e Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Mon, 5 Apr 2021 13:01:00 -0500 Subject: [PATCH] Configure the Tempest venv upper constraints properly We use Tempest master for testing the supported stable branches, so using master upper constraints works fine for such master or stable branch testing, but when we need to use old Tempest in the below cases then master upper constraints do not work for Tempest venv: - Testing Extended Maintenance branch - Testing py2.7 jobs until stable/train with in-tree tempest plugins grenade run smoke test on old devstack and if old devstack does not use the master constraints for Tempest then we need to take care of the same while running the tests too otherwise, it will end up recreating the Tempest venv and flush the already installed tempest plugins and their deps. This commit set the compatible upper constraint according to TEMPEST_VENV_UPPER_CONSTRAINTS variable, which is what used in devstack while creating the Tempest venv and install tempest plugins in that venv. Closes-Bug: 1922597 Change-Id: I66b5d128c3dbe51289410760ea1cbf7f61c55c2f --- grenade.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/grenade.sh b/grenade.sh index 6f36f93b..85ab97e8 100755 --- a/grenade.sh +++ b/grenade.sh @@ -39,6 +39,8 @@ export DSTOOLS_VERSION=${DSTOOLS_VERSION:-0.4.0} source $GRENADE_DIR/grenaderc source $GRENADE_DIR/inc/bootstrap +source $BASE_DEVSTACK_DIR/stackrc + while getopts bqs:t c; do case $c in b) @@ -289,6 +291,20 @@ if [[ "$RUN_BASE" == "True" ]]; then if [[ "$BASE_RUN_SMOKE" == "True" ]]; then echo_summary "Running base smoke test" cd $BASE_RELEASE_DIR/tempest + + # NOTE(gmann): If gate explicitly set the non master + # constraints to use for Tempest venv then use the same + # while running the tests too otherwise, it will recreate + # the Tempest venv due to constraints mismatch. + # recreation of Tempest venv can flush the initially installed + # tempest plugins and their deps. + if [[ "$TEMPEST_VENV_UPPER_CONSTRAINTS" != "master" ]]; then + echo "Using $TEMPEST_VENV_UPPER_CONSTRAINTS constraints in Tempest virtual env." + # 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 tox -esmoke -- --concurrency=$TEMPEST_CONCURRENCY if [ "${GRENADE_USE_EXTERNAL_DEVSTACK}" != "True" ]; then # once we are done, copy our created artifacts to the target