summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorramishra <ramishra@redhat.com>2021-07-30 09:23:05 +0530
committerTakashi Kajinami <tkajinam@redhat.com>2022-06-14 09:36:54 +0000
commit92db02a56e85dd5f890160217a16dc99394b927d (patch)
tree3b07eb1191094a8223bf6c70a3a729bd9ca5aa77
parentb32163d9e35e522577b99110ebd1614de55f5653 (diff)
downloadheat-92db02a56e85dd5f890160217a16dc99394b927d.tar.gz
Use constraints when creating tempest venv
When running tempest we run in-tree tests as well. Lots of these tests including tempest tests may not work with new client libraries. Let's use the relevant branch upper constraints when running functional tests. Change-Id: I6a8cffdc86c895eebe4269c5cd37841325566c54 (cherry picked from commit 22c48f57bb29ed62a8c3249ab953043cfd2617d3) (cherry picked from commit b95e6025f61417e7abc24a26d991bd26c57ee444)
-rw-r--r--roles/run-heat-tests/defaults/main.yaml3
-rw-r--r--roles/run-heat-tests/tasks/main.yaml23
2 files changed, 24 insertions, 2 deletions
diff --git a/roles/run-heat-tests/defaults/main.yaml b/roles/run-heat-tests/defaults/main.yaml
index b601d49d9..22ce4a490 100644
--- a/roles/run-heat-tests/defaults/main.yaml
+++ b/roles/run-heat-tests/defaults/main.yaml
@@ -1,2 +1,5 @@
devstack_base_dir: /opt/stack
tempest_test_timeout: ''
+tempest_tox_environment: {}
+heat_tempest_plugin: /opt/stack/heat-tempest-plugin
+constraints_file: /opt/stack/requirements/upper-constraints.txt
diff --git a/roles/run-heat-tests/tasks/main.yaml b/roles/run-heat-tests/tasks/main.yaml
index 75122f2a1..4af1d0e03 100644
--- a/roles/run-heat-tests/tasks/main.yaml
+++ b/roles/run-heat-tests/tasks/main.yaml
@@ -1,3 +1,23 @@
+- name: Set OS_TEST_TIMEOUT if requested
+ set_fact:
+ tempest_tox_environment: "{{ tempest_tox_environment | combine({'OS_TEST_TIMEOUT': tempest_test_timeout}) }}"
+ when: tempest_test_timeout != ''
+
+- name: Set TOX_CONSTRAINTS_FILE
+ set_fact:
+ tempest_tox_environment: "{{ tempest_tox_environment | combine({'UPPER_CONSTRAINTS_FILE': constraints_file}) | combine({'TOX_CONSTRAINTS_FILE': constraints_file}) }}"
+
+- name: Allow git to read plugin directories
+ become: true
+ command: git config --system --add safe.directory {{heat_tempest_plugin}}
+
+- name: Install plugins
+ command: tox -evenv-tempest -- pip install -c{{constraints_file}} {{heat_tempest_plugin}}
+ become: true
+ args:
+ chdir: "{{devstack_base_dir}}/tempest"
+ environment: "{{ tempest_tox_environment }}"
+
- name: Run heat tests
command: tox -evenv-tempest -- stestr --test-path={{devstack_base_dir}}/heat/heat_integrationtests \
--top-dir={{devstack_base_dir}}/heat \
@@ -5,5 +25,4 @@
args:
chdir: "{{devstack_base_dir}}/tempest"
become: true
- become_user: tempest
- environment: '{{ {"OS_TEST_TIMEOUT": tempest_test_timeout} if tempest_test_timeout else {} }}'
+ environment: "{{ tempest_tox_environment }}"