File tree Expand file tree Collapse file tree
tools/roles/tools_stage_results/tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change 104104 - name : Mark the openshift tests as UNSTABLE
105105 ansible.builtin.include_role :
106106 name : tools_stage_results
107- tasks_from : mark_stage_unstable .yml
107+ tasks_from : mark_test_stage_unstable .yml
108108 vars :
109109 unstable_msg : >-
110110 The openshift test Suite failed.
Original file line number Diff line number Diff line change 2828 - name : Mark the CPMS {{ cpms_tests_type }} tests as UNSTABLE
2929 ansible.builtin.include_role :
3030 name : tools_stage_results
31- tasks_from : mark_stage_unstable .yml
31+ tasks_from : mark_test_stage_unstable .yml
3232 vars :
3333 unstable_msg : >-
3434 The {{ cpms_test_name }} {{ cpms_tests_type }} test suite failed.
Original file line number Diff line number Diff line change 2828 - name : Mark the openshift tests as UNSTABLE
2929 ansible.builtin.include_role :
3030 name : tools_stage_results
31- tasks_from : mark_stage_unstable .yml
31+ tasks_from : mark_test_stage_unstable .yml
3232 vars :
3333 unstable_msg : >-
3434 The openshift test Suite failed.
Original file line number Diff line number Diff line change 9393 - name : Mark the egressip tests as UNSTABLE
9494 ansible.builtin.include_role :
9595 name : tools_stage_results
96- tasks_from : mark_stage_unstable .yml
96+ tasks_from : mark_test_stage_unstable .yml
9797 vars :
9898 unstable_msg : >-
9999 The EgressIP test suite failed.
Original file line number Diff line number Diff line change 207207 - name : Mark the openshift tests as UNSTABLE
208208 ansible.builtin.include_role :
209209 name : tools_stage_results
210- tasks_from : mark_stage_unstable .yml
210+ tasks_from : mark_test_stage_unstable .yml
211211 vars :
212212 unstable_msg : >-
213213 The openshift test Suite failed.
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ ---
2+ - name : Check whether any testing stage was marked UNSTABLE
3+ ansible.builtin.stat :
4+ path : " {{ test_stage_unstable_flag }}"
5+ register : _test_stage_unstable_flag
6+
7+ - name : Read accumulated UNSTABLE testing stage messages
8+ ansible.builtin.set_fact :
9+ _test_stage_unstable_messages : >-
10+ {{ lookup('ansible.builtin.file', test_stage_unstable_flag)
11+ | split('\n')
12+ | map('trim')
13+ | reject('equalto', '')
14+ | list
15+ | join('; ') }}
16+ when : _test_stage_unstable_flag.stat.exists
17+
18+ - name : Print accumulated UNSTABLE testing stage messages
19+ ansible.builtin.debug :
20+ msg : " {{ _test_stage_unstable_messages }}"
21+ when : _test_stage_unstable_flag.stat.exists
22+
23+ - name : Fail the playbook when any testing stage was marked UNSTABLE
24+ ansible.builtin.fail :
25+ msg : >-
26+ One or more testing stages were marked UNSTABLE:
27+ {{ _test_stage_unstable_messages }}
28+ when : _test_stage_unstable_flag.stat.exists
Original file line number Diff line number Diff line change 1+ ---
2+ - name : Set the test stage unstable var as true
3+ ansible.builtin.set_fact :
4+ test_stage_unstable : true
5+ unstable_warning : " Warning! {{ unstable_msg }}"
6+
7+ - name : Print the test stage UNSTABLE message
8+ ansible.builtin.debug :
9+ msg : " {{ unstable_warning }}"
10+
11+ - name : Mark the test stage result as UNSTABLE
12+ ansible.builtin.lineinfile :
13+ path : " {{ test_stage_unstable_flag }}"
14+ line : " {{ unstable_warning }}"
15+ create : yes
16+ mode : u=rw,g=rw,o=r
17+ delegate_to : localhost
Original file line number Diff line number Diff line change @@ -32,11 +32,13 @@ 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 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.
35+ # The resources_file and stage_unstable flags are on the Ansible control node's HOME.
36+ # test_stage_unstable_flag is written only by testing-stage rescues; ocp_testing.yaml
37+ # fails at the end if it exists so Zuul can report UNSTABLE for test failures.
38+ # stage_unstable_flag is used by soft verification/install workarounds (no end-of-run fail).
3839resources_file : " {{ controller_home_dir }}/artifacts/resources.yml"
3940stage_unstable_flag : " {{ controller_home_dir }}/artifacts/stage_unstable_flag"
41+ test_stage_unstable_flag : " {{ controller_home_dir }}/artifacts/test_stage_unstable_flag"
4042
4143admin_cloud : " default"
4244admin_env_file : " {{ osp_config_dir }}/{{ admin_cloud }}rc"
Original file line number Diff line number Diff line change 1010 path : " {{ stage_unstable_flag }}"
1111 state : absent
1212
13+ - name : Cleanup workspace flags - Remove the test_stage_unstable_flag if it exists
14+ ansible.builtin.file :
15+ path : " {{ test_stage_unstable_flag }}"
16+ state : absent
17+
1318 - name : Update ocp_deployment_topology with overrides if defined
1419 # Apply ocp_deployment_topology_override on top of the base topology
1520 # The base configuration comes from `configs/global.yml`
120125 ansible.builtin.import_playbook : plays/egressip_tests.yaml
121126 when : " 'egressip_tests' in stages"
122127
123- - name : Fail if any stage was marked UNSTABLE
128+ - name : Fail if any testing stage was marked UNSTABLE
124129 hosts : localhost
125130 gather_facts : false
126131 vars_files :
127132 - " ../configs/global.yml"
128133 tasks :
129- - name : Check accumulated UNSTABLE stages and fail the playbook
134+ - name : Check accumulated UNSTABLE testing stages and fail the playbook
130135 ansible.builtin.include_role :
131136 name : tools_stage_results
132- tasks_from : fail_if_stage_unstable .yml
137+ tasks_from : fail_if_test_stage_unstable .yml
You can’t perform that action at this time.
0 commit comments