Handle the case when tempest fails

Before this change, the errors from tempest run are suppressed
in order to always execute cinderlib tests.

Use the variable exported by run-tempest instead,
and fail properly if needed.

This is a port of Ic1fd6fcc9b9183f195c66f0022e913ae9734c97b
from cinder-tempest-plugin.git to this repository.

Change-Id: I216a82a29c7fb6b1b2fac95b2a1af667c4e2b22d
This commit is contained in:
Luigi Toscano 2022-05-03 17:22:27 +02:00
parent a540555457
commit 7e04b5b0d4

View File

@ -19,7 +19,7 @@
- setup-tempest-data-dir
- acl-devstack-files
- role: run-tempest
# ignore the errors, so that run-cinderlib-tests is always executed
# ignore the errors here (but consider them later), so that run-cinderlib-tests is always executed
ignore_errors: yes
- role: change-devstack-data-owner
devstack_data_subdir_changed: cinder
@ -27,3 +27,8 @@
- role: run-cinderlib-tests
tox_install_siblings: false
cinderlib_base_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/cinderlib'].src_dir }}"
- name: Fail if the first tempest run did not work
msg: "tempest run returned with an error"
when: tempest_run_result is defined and tempest_run_result.rc != 0