From 62d11d8479045b31ee6ec29ce5403652a208e327 Mon Sep 17 00:00:00 2001 From: Ghanshyam Mann Date: Wed, 10 Feb 2021 11:41:48 -0600 Subject: [PATCH] Use configured upper-constraints for non-master Tempest run If any job use older Tempest version then we can not need to use the master upper-constraints as they can be incompatible most of the time. We need to use the compatible constraints of what version of Tempest is configured to run. Below devstack patch adding the new way to configure the upper-constraints via new variable TEMPEST_VENV_UPPER_CONSTRAINTS when Tempest master is not used. - https://review.opendev.org/c/openstack/devstack/+/774711 We need to use the same variable to use the configured constraints in run-tempest roles also so that when run-tempest recreate the tempest venv then it honor the same configured constraints instead if using master and error For example: - https://zuul.opendev.org/t/openstack/build/854450dc514041a78fd250dde0eb138e/log/job-output.txt#31341 Depends-On: https://review.opendev.org/c/openstack/devstack/+/774716 Change-Id: I32d539b02366c8ae7ea70195674a97ed6a8ae759 --- roles/run-tempest/defaults/main.yaml | 3 +++ roles/run-tempest/tasks/main.yaml | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/roles/run-tempest/defaults/main.yaml b/roles/run-tempest/defaults/main.yaml index 52713befad..5f13883237 100644 --- a/roles/run-tempest/defaults/main.yaml +++ b/roles/run-tempest/defaults/main.yaml @@ -6,3 +6,6 @@ tempest_test_timeout: '' stable_constraints_file: "{{ devstack_base_dir }}/requirements/upper-constraints.txt" target_branch: "{{ zuul.branch }}" tempest_tox_environment: {} +# NOTE(gmann): external_bridge_mtu shows as undefined for run-tempest role +# defining default value here to avoid that error. +external_bridge_mtu: 0 diff --git a/roles/run-tempest/tasks/main.yaml b/roles/run-tempest/tasks/main.yaml index 5b00de3402..37026e4df5 100644 --- a/roles/run-tempest/tasks/main.yaml +++ b/roles/run-tempest/tasks/main.yaml @@ -31,6 +31,17 @@ tempest_tox_environment: "{{ tempest_tox_environment | combine({'UPPER_CONSTRAINTS_FILE': stable_constraints_file}) | combine({'TOX_CONSTRAINTS_FILE': stable_constraints_file}) }}" when: target_branch in ["stable/ocata", "stable/pike", "stable/queens", "stable/rocky", "stable/stein"] +- name: Use Configured upper-constraints for non-master Tempest + set_fact: + # TOX_CONSTRAINTS_FILE is new name, UPPER_CONSTRAINTS_FILE is old one, best to set both + tempest_tox_environment: "{{ tempest_tox_environment | combine({'UPPER_CONSTRAINTS_FILE': devstack_localrc['TEMPEST_VENV_UPPER_CONSTRAINTS']}) | combine({'TOX_CONSTRAINTS_FILE': devstack_localrc['TEMPEST_VENV_UPPER_CONSTRAINTS']}) }}" + when: + - devstack_localrc is defined + - "'TEMPEST_BRANCH' in devstack_localrc" + - "'TEMPEST_VENV_UPPER_CONSTRAINTS' in devstack_localrc" + - devstack_localrc['TEMPEST_BRANCH'] != 'master' + - devstack_localrc['TEMPEST_VENV_UPPER_CONSTRAINTS'] != 'default' + - name: Set OS_TEST_TIMEOUT if requested set_fact: tempest_tox_environment: "{{ tempest_tox_environment | combine({'OS_TEST_TIMEOUT': tempest_test_timeout}) }}"