From 7e04b5b0d4c91df7601e8e7f36d49fb6d651ea2b Mon Sep 17 00:00:00 2001 From: Luigi Toscano Date: Tue, 3 May 2022 17:22:27 +0200 Subject: [PATCH] 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 --- playbooks/tempest-and-cinderlib-run.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/playbooks/tempest-and-cinderlib-run.yaml b/playbooks/tempest-and-cinderlib-run.yaml index cbb33273daa..e71417d2b91 100644 --- a/playbooks/tempest-and-cinderlib-run.yaml +++ b/playbooks/tempest-and-cinderlib-run.yaml @@ -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 }}" + post_tasks: + - name: Fail if the first tempest run did not work + fail: + msg: "tempest run returned with an error" + when: tempest_run_result is defined and tempest_run_result.rc != 0