cinder/playbooks/tempest-and-cinderlib-run.yaml
Luigi Toscano 391f7c7f9b 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
(cherry picked from commit 7e04b5b0d4)
2022-05-03 22:04:56 +02:00

35 lines
1.4 KiB
YAML

# Playbook imported from https://opendev.org/openstack/tempest/src/tag/23.0.0/playbooks/devstack-tempest.yaml
# Changes that run through devstack-tempest are likely to have an impact on
# the devstack part of the job, so we keep devstack in the main play to
# avoid zuul retrying on legitimate failures.
- hosts: all
roles:
- orchestrate-devstack
# We run tests only on one node, regardless how many nodes are in the system
- hosts: tempest
environment:
# This environment variable is used by the optional tempest-gabbi
# job provided by the gabbi-tempest plugin. It can be safely ignored
# if that plugin is not being used.
GABBI_TEMPEST_PATH: "{{ gabbi_tempest_path | default('') }}"
roles:
- setup-tempest-run-dir
- setup-tempest-data-dir
- acl-devstack-files
- role: run-tempest
# 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
devstack_data_subdir_owner: zuul
- 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