Skip to content

Commit f31c697

Browse files
Write test_stage_unstable_flag for post-run POST_FAILURE (yellow Zuul UI)
Testing stages write test_stage_unstable_flag on failure via rescue blocks instead of failing the run playbook. Soft verification checks keep using stage_unstable_flag without triggering job failure. No end-of-playbook fail in ocp_testing.yaml. ci-framework-jobs post-run check-test-unstable-post.yaml consumes the flag and fails with POST_FAILURE (yellow/unstable in Zuul) while the run phase stays SUCCESS. Cleanup of test_stage_unstable_flag uses delegate_to: localhost to match mark_test_stage_unstable.yml and always remove the flag on the control node. Depends-On: https://gitlab.cee.redhat.com/ci-framework/ci-framework-jobs/-/merge_requests/3556 Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent dc76c06 commit f31c697

9 files changed

Lines changed: 35 additions & 7 deletions

File tree

collection/stages/roles/conformance_test/tasks/run_conformance_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
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.

collection/stages/roles/cpms_test/tasks/run_cpms_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
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.

collection/stages/roles/csi_tests/tasks/run_csi_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
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.

collection/stages/roles/egressip_tests/tasks/run_egressip_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
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.

collection/stages/roles/openstack_test/tasks/run_openstack_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
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.

collection/stages/roles/verification/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cinder_csi_project_name: cinder-test # project for testing cinder-csi sc provide
55
manila_project_name: manila-test # project for testing manila sc provider
66
demo_project_name: demo # project for testing demo app
77
verify_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.
99
alerts_to_ignore:
1010
# - 'Watchdog' # Should not be considered as severity is none
1111
- 'NodeClockNotSynchronising'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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

configs/global.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,14 @@ report_dir: "{{ artifacts_dir }}/test_results"
3232

3333
# Sets the Ansible Controller Node machine's HOME environment variable
3434
controller_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 flags are on the Ansible control node's HOME.
36+
# test_stage_unstable_flag is written only by testing-stage rescues. The ci-framework-jobs
37+
# post-run playbook check-test-unstable-post.yaml fails Zuul POST_FAILURE when this file
38+
# is present in rsynced shiftstack artifacts (run phase stays SUCCESS).
39+
# stage_unstable_flag is used by soft verification/install workarounds (no end-of-run fail).
3640
resources_file: "{{ controller_home_dir }}/artifacts/resources.yml"
3741
stage_unstable_flag: "{{ controller_home_dir }}/artifacts/stage_unstable_flag"
42+
test_stage_unstable_flag: "{{ controller_home_dir }}/artifacts/test_stage_unstable_flag"
3843

3944
admin_cloud: "default"
4045
admin_env_file: "{{ osp_config_dir }}/{{ admin_cloud }}rc"

playbooks/ocp_testing.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
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+
delegate_to: localhost
18+
1319
- name: Update ocp_deployment_topology with overrides if defined
1420
# Apply ocp_deployment_topology_override on top of the base topology
1521
# The base configuration comes from `configs/global.yml`

0 commit comments

Comments
 (0)