diff --git a/collection/stages/roles/conformance_test/tasks/run_conformance_test.yml b/collection/stages/roles/conformance_test/tasks/run_conformance_test.yml index ef205125..9869082b 100644 --- a/collection/stages/roles/conformance_test/tasks/run_conformance_test.yml +++ b/collection/stages/roles/conformance_test/tasks/run_conformance_test.yml @@ -104,7 +104,7 @@ - name: Mark the openshift tests as UNSTABLE ansible.builtin.include_role: name: tools_stage_results - tasks_from: mark_stage_unstable.yml + tasks_from: mark_test_stage_unstable.yml vars: unstable_msg: >- The openshift test Suite failed. diff --git a/collection/stages/roles/cpms_test/tasks/run_cpms_test.yml b/collection/stages/roles/cpms_test/tasks/run_cpms_test.yml index 27dcf91d..ce38a418 100644 --- a/collection/stages/roles/cpms_test/tasks/run_cpms_test.yml +++ b/collection/stages/roles/cpms_test/tasks/run_cpms_test.yml @@ -28,7 +28,7 @@ - name: Mark the CPMS {{ cpms_tests_type }} tests as UNSTABLE ansible.builtin.include_role: name: tools_stage_results - tasks_from: mark_stage_unstable.yml + tasks_from: mark_test_stage_unstable.yml vars: unstable_msg: >- The {{ cpms_test_name }} {{ cpms_tests_type }} test suite failed. diff --git a/collection/stages/roles/csi_tests/tasks/run_csi_test.yml b/collection/stages/roles/csi_tests/tasks/run_csi_test.yml index a91ec213..07209499 100644 --- a/collection/stages/roles/csi_tests/tasks/run_csi_test.yml +++ b/collection/stages/roles/csi_tests/tasks/run_csi_test.yml @@ -28,7 +28,7 @@ - name: Mark the openshift tests as UNSTABLE ansible.builtin.include_role: name: tools_stage_results - tasks_from: mark_stage_unstable.yml + tasks_from: mark_test_stage_unstable.yml vars: unstable_msg: >- The openshift test Suite failed. diff --git a/collection/stages/roles/egressip_tests/tasks/run_egressip_tests.yml b/collection/stages/roles/egressip_tests/tasks/run_egressip_tests.yml index 9373b0b1..5255950d 100644 --- a/collection/stages/roles/egressip_tests/tasks/run_egressip_tests.yml +++ b/collection/stages/roles/egressip_tests/tasks/run_egressip_tests.yml @@ -93,7 +93,7 @@ - name: Mark the egressip tests as UNSTABLE ansible.builtin.include_role: name: tools_stage_results - tasks_from: mark_stage_unstable.yml + tasks_from: mark_test_stage_unstable.yml vars: unstable_msg: >- The EgressIP test suite failed. diff --git a/collection/stages/roles/openstack_test/tasks/run_openstack_test.yml b/collection/stages/roles/openstack_test/tasks/run_openstack_test.yml index 5896bf9f..eabf25ac 100644 --- a/collection/stages/roles/openstack_test/tasks/run_openstack_test.yml +++ b/collection/stages/roles/openstack_test/tasks/run_openstack_test.yml @@ -207,7 +207,7 @@ - name: Mark the openshift tests as UNSTABLE ansible.builtin.include_role: name: tools_stage_results - tasks_from: mark_stage_unstable.yml + tasks_from: mark_test_stage_unstable.yml vars: unstable_msg: >- The openshift test Suite failed. diff --git a/collection/stages/roles/verification/defaults/main.yml b/collection/stages/roles/verification/defaults/main.yml index 8407a724..f2d2c054 100644 --- a/collection/stages/roles/verification/defaults/main.yml +++ b/collection/stages/roles/verification/defaults/main.yml @@ -5,7 +5,7 @@ cinder_csi_project_name: cinder-test # project for testing cinder-csi sc provide manila_project_name: manila-test # project for testing manila sc provider demo_project_name: demo # project for testing demo app verify_existing_namespace: false -soft_checks: true # run checks that won't stop the playbook but will generate the jenkins message to mark the run as unstable. +soft_checks: true # run checks that won't stop the playbook but will mark the run as UNSTABLE via stage_unstable_flag. alerts_to_ignore: # - 'Watchdog' # Should not be considered as severity is none - 'NodeClockNotSynchronising' diff --git a/collection/tools/roles/tools_stage_results/tasks/mark_test_stage_unstable.yml b/collection/tools/roles/tools_stage_results/tasks/mark_test_stage_unstable.yml new file mode 100644 index 00000000..7da27d04 --- /dev/null +++ b/collection/tools/roles/tools_stage_results/tasks/mark_test_stage_unstable.yml @@ -0,0 +1,17 @@ +--- +- name: Set the test stage unstable var as true + ansible.builtin.set_fact: + test_stage_unstable: true + unstable_warning: "Warning! {{ unstable_msg }}" + +- name: Print the test stage UNSTABLE message + ansible.builtin.debug: + msg: "{{ unstable_warning }}" + +- name: Mark the test stage result as UNSTABLE + ansible.builtin.lineinfile: + path: "{{ test_stage_unstable_flag }}" + line: "{{ unstable_warning }}" + create: yes + mode: u=rw,g=rw,o=r + delegate_to: localhost diff --git a/configs/global.yml b/configs/global.yml index fde8871b..198d7a85 100644 --- a/configs/global.yml +++ b/configs/global.yml @@ -32,9 +32,14 @@ report_dir: "{{ artifacts_dir }}/test_results" # Sets the Ansible Controller Node machine's HOME environment variable controller_home_dir: "{{ lookup('ansible.builtin.env', 'HOME') }}" -# The resources_file and stage_unstable_flag are in the Ansible control node's HOME environment variable +# The resources_file and stage_unstable flags are on the Ansible control node's HOME. +# test_stage_unstable_flag is written only by testing-stage rescues. The ci-framework +# shiftstack role fails the Zuul job when this file is present in rsynced artifacts; +# pair with failure-message: unstable on monolithic shiftstack Zuul jobs for yellow UI. +# stage_unstable_flag is used by soft verification/install workarounds (no end-of-run fail). resources_file: "{{ controller_home_dir }}/artifacts/resources.yml" stage_unstable_flag: "{{ controller_home_dir }}/artifacts/stage_unstable_flag" +test_stage_unstable_flag: "{{ controller_home_dir }}/artifacts/test_stage_unstable_flag" admin_cloud: "default" admin_env_file: "{{ osp_config_dir }}/{{ admin_cloud }}rc" diff --git a/playbooks/ocp_testing.yaml b/playbooks/ocp_testing.yaml index 11607048..d1314187 100644 --- a/playbooks/ocp_testing.yaml +++ b/playbooks/ocp_testing.yaml @@ -10,6 +10,11 @@ path: "{{ stage_unstable_flag }}" state: absent + - name: Cleanup workspace flags - Remove the test_stage_unstable_flag if it exists + ansible.builtin.file: + path: "{{ test_stage_unstable_flag }}" + state: absent + - name: Update ocp_deployment_topology with overrides if defined # Apply ocp_deployment_topology_override on top of the base topology # The base configuration comes from `configs/global.yml`