File tree Expand file tree Collapse file tree
stages/roles/verification/defaults
tools/roles/tools_stage_results/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ cinder_csi_project_name: cinder-test # project for testing cinder-csi sc provide
55manila_project_name : manila-test # project for testing manila sc provider
66demo_project_name : demo # project for testing demo app
77verify_existing_namespace : false
8- soft_checks : true # run checks that won't stop the playbook but will generate the jenkins message to mark the run as unstable .
8+ soft_checks : true # run checks that won't stop the playbook but will mark the run as UNSTABLE via stage_unstable_flag .
99alerts_to_ignore :
1010 # - 'Watchdog' # Should not be considered as severity is none
1111 - ' NodeClockNotSynchronising'
Original file line number Diff line number Diff line change 1+ ---
2+ - name : Check whether any stage was marked UNSTABLE
3+ ansible.builtin.stat :
4+ path : " {{ stage_unstable_flag }}"
5+ register : _stage_unstable_flag
6+
7+ - name : Read accumulated UNSTABLE stage messages
8+ ansible.builtin.set_fact :
9+ _stage_unstable_messages : >-
10+ {{ lookup('ansible.builtin.file', stage_unstable_flag)
11+ | split('\n')
12+ | map('trim')
13+ | reject('equalto', '')
14+ | list
15+ | join('; ') }}
16+ when : _stage_unstable_flag.stat.exists
17+
18+ - name : Print accumulated UNSTABLE stage messages
19+ ansible.builtin.debug :
20+ msg : " {{ _stage_unstable_messages }}"
21+ when : _stage_unstable_flag.stat.exists
22+
23+ - name : Fail the playbook when any stage was marked UNSTABLE
24+ ansible.builtin.fail :
25+ msg : >-
26+ One or more stages were marked UNSTABLE:
27+ {{ _stage_unstable_messages }}
28+ when : _stage_unstable_flag.stat.exists
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ report_dir: "{{ artifacts_dir }}/test_results"
3232
3333# Sets the Ansible Controller Node machine's HOME environment variable
3434controller_home_dir : " {{ lookup('ansible.builtin.env', 'HOME') }}"
35- # The resources_file and stage_unstable_flag are in the Ansible control node's HOME environment variable
35+ # The resources_file and stage_unstable_flag are on the Ansible control node's HOME.
36+ # stage_unstable_flag accumulates UNSTABLE stage messages during the run; ocp_testing.yaml
37+ # fails at the end if the file exists so Zuul/ci-framework see a non-zero exit.
3638resources_file : " {{ controller_home_dir }}/artifacts/resources.yml"
3739stage_unstable_flag : " {{ controller_home_dir }}/artifacts/stage_unstable_flag"
3840
Original file line number Diff line number Diff line change 119119- name : Run EgressIP tests on OpenShift
120120 ansible.builtin.import_playbook : plays/egressip_tests.yaml
121121 when : " 'egressip_tests' in stages"
122+
123+ - name : Fail if any stage was marked UNSTABLE
124+ hosts : localhost
125+ gather_facts : false
126+ vars_files :
127+ - " ../configs/global.yml"
128+ tasks :
129+ - name : Check accumulated UNSTABLE stages and fail the playbook
130+ ansible.builtin.include_role :
131+ name : tools_stage_results
132+ tasks_from : fail_if_stage_unstable.yml
You can’t perform that action at this time.
0 commit comments