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

If heat integration test script does not use the master constraints
for Tempest (when any stable branch goes to Extended Maintenance state)
then we need to use the same constraints while running the tests too
otherwise, it will end up recreating the Tempest venv and remove the
already installed tempest plugins and their deps.

This commit set the compatible upper constraint
according the stable branch Tempest version.

Closes-Bug: 1922597
Change-Id: Ib33b5688153f07e696a39b26510b22fe128597ea
This commit is contained in:
Ghanshyam Mann 2021-04-05 16:55:09 -05:00 committed by Radosław Piliszek
parent ba2ed09ba1
commit 2f6e1169ec
2 changed files with 22 additions and 4 deletions

View File

@ -82,7 +82,6 @@
- ^heat/tests/.*$ - ^heat/tests/.*$
- ^releasenotes/.*$ - ^releasenotes/.*$
- ^setup.cfg$ - ^setup.cfg$
voting: false
vars: vars:
configure_swap_size: 8192 configure_swap_size: 8192
topology: aio topology: aio
@ -95,7 +94,6 @@
roles: roles:
- zuul: zuul/zuul-jobs - zuul: zuul/zuul-jobs
pre-run: playbooks/devstack/multinode-networking/pre.yaml pre-run: playbooks/devstack/multinode-networking/pre.yaml
voting: false
vars: vars:
topology: multinode topology: multinode

View File

@ -55,6 +55,7 @@ EOF
function _run_heat_integrationtests { function _run_heat_integrationtests {
local devstack_dir=$1 local devstack_dir=$1
local use_stable_constraints=$2
pushd $devstack_dir/../tempest pushd $devstack_dir/../tempest
export DEST=$(dirname $devstack_dir) export DEST=$(dirname $devstack_dir)
@ -65,6 +66,25 @@ function _run_heat_integrationtests {
UPGRADE_TESTS=upgrade_tests.list UPGRADE_TESTS=upgrade_tests.list
_write_heat_integrationtests $UPGRADE_TESTS _write_heat_integrationtests $UPGRADE_TESTS
# NOTE(gmann): If devstack is pinned to use the non master
# Tempest and constraints 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 [[ $use_stable_constraints == "True" ]]; then
echo "Using $DEST/requirements/upper-constraints.txt constraints in Tempest venv."
# 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=$DEST/requirements/upper-constraints.txt
export TOX_CONSTRAINTS_FILE=$UPPER_CONSTRAINTS_FILE
else
echo "Using master constraints in Tempest venv."
# 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=https://releases.openstack.org/constraints/upper/master
export TOX_CONSTRAINTS_FILE=$UPPER_CONSTRAINTS_FILE
fi
tox -evenv-tempest -- stestr --test-path=$DEST/heat/heat_integrationtests --top-dir=$DEST/heat \ tox -evenv-tempest -- stestr --test-path=$DEST/heat/heat_integrationtests --top-dir=$DEST/heat \
--group_regex='heat_tempest_plugin\.tests\.api\.test_heat_api[._]([^_]+)' \ --group_regex='heat_tempest_plugin\.tests\.api\.test_heat_api[._]([^_]+)' \
run --whitelist-file $UPGRADE_TESTS run --whitelist-file $UPGRADE_TESTS
@ -75,7 +95,7 @@ function _run_heat_integrationtests {
function create { function create {
if [ "${RUN_HEAT_INTEGRATION_TESTS}" == "True" ]; then if [ "${RUN_HEAT_INTEGRATION_TESTS}" == "True" ]; then
# run heat integration tests instead of tempest smoke before create # run heat integration tests instead of tempest smoke before create
_run_heat_integrationtests $BASE_DEVSTACK_DIR _run_heat_integrationtests $BASE_DEVSTACK_DIR "True"
fi fi
source $TOP_DIR/openrc admin admin source $TOP_DIR/openrc admin admin
@ -113,7 +133,7 @@ function verify {
local side="$1" local side="$1"
if [[ "$side" = "post-upgrade" ]]; then if [[ "$side" = "post-upgrade" ]]; then
if [ "${RUN_HEAT_INTEGRATION_TESTS}" == "True" ]; then if [ "${RUN_HEAT_INTEGRATION_TESTS}" == "True" ]; then
_run_heat_integrationtests $TARGET_DEVSTACK_DIR _run_heat_integrationtests $TARGET_DEVSTACK_DIR "False"
fi fi
fi fi
stack_name=$(resource_get heat stack_name) stack_name=$(resource_get heat stack_name)