From 6f950c0ab2cb05f31784147826d92eeb7d71e0df Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Wed, 27 Nov 2024 18:44:39 +0000 Subject: [PATCH] [common] Update task names for XML reporting --- roles/common/tasks/container_test.yml | 4 +++- roles/common/tasks/cr_tests.yml | 9 +++++++-- roles/common/tasks/crd_tests.yml | 6 ++++-- roles/common/tasks/endpoint_tests.yml | 6 ++++-- roles/common/tasks/manifest_tests.yml | 6 ++++-- roles/common/tasks/pod_tests.yml | 4 +++- roles/common/tasks/project_tests.yml | 6 ++++-- roles/common/tasks/subscription_tests.yml | 6 ++++-- roles/telemetry_graphing/tasks/cypress_test.yml | 10 +++------- roles/telemetry_graphing/tasks/verify_url.yml | 4 +--- 10 files changed, 37 insertions(+), 24 deletions(-) diff --git a/roles/common/tasks/container_test.yml b/roles/common/tasks/container_test.yml index 71b84ac5..db219d74 100644 --- a/roles/common/tasks/container_test.yml +++ b/roles/common/tasks/container_test.yml @@ -6,7 +6,9 @@ changed_when: false register: container_status -- name: Verify container status {{ common_container_test_id }} +- name: | + Verify {{ container_name }} container status + {{ common_container_test_id }} ansible.builtin.assert: that: - "'unhealthy' not in container_status.stdout" diff --git a/roles/common/tasks/cr_tests.yml b/roles/common/tasks/cr_tests.yml index fcb646d7..183bf472 100644 --- a/roles/common/tasks/cr_tests.yml +++ b/roles/common/tasks/cr_tests.yml @@ -1,4 +1,7 @@ -- name: Verify that a CR exists {{ common_cr_test_id }} +--- +- name: | + TEST Verify that the {{ item.kind }} {{ item.name }} CR exists + {{ common_cr_test_id }} ansible.builtin.command: cmd: | oc get {{ item.kind }} {{ item.name }} @@ -7,7 +10,9 @@ failed_when: - result.rc != 0 -- name: Verify that a CR is ready {{ common_cr_ready_test_id }} +- name: | + TEST Verify that the {{ item.kind }} {{ item.name }} CR is ready + {{ common_cr_ready_test_id }} ansible.builtin.command: cmd: | oc get {{ item.kind }} {{ item.name }} -o jsonpath='{.status.conditions[?(@.type=="{{ item.condition_type }}")].status}{"\n"}' diff --git a/roles/common/tasks/crd_tests.yml b/roles/common/tasks/crd_tests.yml index e618d204..06615c6b 100644 --- a/roles/common/tasks/crd_tests.yml +++ b/roles/common/tasks/crd_tests.yml @@ -6,9 +6,11 @@ changed_when: false register: output -- name: Verify CRD is found "{{ common_crd_test_id }}" +- name: | + TEST Verify CRD {{ item }} is found + {{ common_crd_test_id }} ansible.builtin.assert: that: - "'NotFound' not in output.stderr" success_msg: "CRD {{ item }} is found." - fail_msg: "CRD {{ item }} not found. Error: {{ output.stderr }}" \ No newline at end of file + fail_msg: "CRD {{ item }} not found. Error: {{ output.stderr }}" diff --git a/roles/common/tasks/endpoint_tests.yml b/roles/common/tasks/endpoint_tests.yml index cdea10ea..de7bac18 100644 --- a/roles/common/tasks/endpoint_tests.yml +++ b/roles/common/tasks/endpoint_tests.yml @@ -6,9 +6,11 @@ changed_when: false register: output -- name: Check that endpoint exist {{ common_endpoint_test_id }} +- name: | + TEST Check that {{ item[0] }} endpoint exists + {{ common_endpoint_test_id }} ansible.builtin.assert: that: - output.stdout != "" success_msg: "The endpoint {{ item[0] }} is found." - fail_msg: "The endpoint for service {{ item[0] }} " \ No newline at end of file + fail_msg: "The endpoint for service {{ item[0] }} " diff --git a/roles/common/tasks/manifest_tests.yml b/roles/common/tasks/manifest_tests.yml index 63e03aa7..48c4ab86 100644 --- a/roles/common/tasks/manifest_tests.yml +++ b/roles/common/tasks/manifest_tests.yml @@ -13,10 +13,12 @@ register: pack_name changed_when: false -- name: Get packagemanifest "{{ common_manifest_test_id }}" +- name: | + TEST Get {{ item }} packagemanifest + {{ common_manifest_test_id }} ansible.builtin.shell: cmd: | oc get packagemanifests | grep "{{ pack_name.stdout }}" | wc -l register: num_found changed_when: false - failed_when: num_expected.stdout != num_found.stdout \ No newline at end of file + failed_when: num_expected.stdout != num_found.stdout diff --git a/roles/common/tasks/pod_tests.yml b/roles/common/tasks/pod_tests.yml index 97e2b5b7..a936f117 100644 --- a/roles/common/tasks/pod_tests.yml +++ b/roles/common/tasks/pod_tests.yml @@ -11,7 +11,9 @@ - podinstance.stdout_lines | length != 1 changed_when: false - - name: Check pod {{ common_pod_test_id }} + - name: | + TEST Check {{ item }} pod + {{ common_pod_test_id }} ansible.builtin.command: cmd: | oc get pod -n "{{ common_pod_nspace }}" "{{ podinstance.stdout }}" diff --git a/roles/common/tasks/project_tests.yml b/roles/common/tasks/project_tests.yml index 1d0be76e..0b88760b 100644 --- a/roles/common/tasks/project_tests.yml +++ b/roles/common/tasks/project_tests.yml @@ -6,9 +6,11 @@ changed_when: false register: output -- name: Verify project is found "{{ common_project_test_id }}" +- name: | + TEST Verify {{ item }} project is found + "{{ common_project_test_id }}" ansible.builtin.assert: that: - "'NotFound' not in output.stderr" success_msg: "project {{ item }} is found." - fail_msg: "project {{ item }} not found. Error: {{ output.stderr }}" \ No newline at end of file + fail_msg: "project {{ item }} not found. Error: {{ output.stderr }}" diff --git a/roles/common/tasks/subscription_tests.yml b/roles/common/tasks/subscription_tests.yml index 49f2b6db..7c36f1dd 100644 --- a/roles/common/tasks/subscription_tests.yml +++ b/roles/common/tasks/subscription_tests.yml @@ -6,9 +6,11 @@ changed_when: false register: output -- name: Check that subscription exist {{ common_subscription_test_id }} +- name: | + TEST Check that {{ item }} subscription exists + {{ common_subscription_test_id }} ansible.builtin.assert: that: - "'NotFound' not in output.stderr" success_msg: "subscription {{ item }} is found." - fail_msg: "subscription {{ item }} not found. Error: {{ output.stderr }}" \ No newline at end of file + fail_msg: "subscription {{ item }} not found. Error: {{ output.stderr }}" diff --git a/roles/telemetry_graphing/tasks/cypress_test.yml b/roles/telemetry_graphing/tasks/cypress_test.yml index fdeb9dca..604dec37 100644 --- a/roles/telemetry_graphing/tasks/cypress_test.yml +++ b/roles/telemetry_graphing/tasks/cypress_test.yml @@ -60,9 +60,7 @@ chdir: "{{ cypress_tests_dir }}" changed_when: false -- name: | - TEST Cypress tests to validate dashboards exist - RHOSO-13627 +- name: "UI-2 Run Cypress tests to validate dashboards exist" ansible.builtin.shell: | Xvfb :99 -ac & export DISPLAY=:99 @@ -82,9 +80,7 @@ ansible.builtin.debug: var: cypress_run.stdout_lines -- name: | - TEST Check if all Cypress tests passed - RHOSO-13628 +- name: "UI-3 Check if all Cypress tests passed" ansible.builtin.fail: msg: "Some Cypress tests failed." - when: cypress_run.rc != 0 + when: cypress_run.rc != 0 \ No newline at end of file diff --git a/roles/telemetry_graphing/tasks/verify_url.yml b/roles/telemetry_graphing/tasks/verify_url.yml index e45a0ce5..4602355e 100644 --- a/roles/telemetry_graphing/tasks/verify_url.yml +++ b/roles/telemetry_graphing/tasks/verify_url.yml @@ -10,9 +10,7 @@ ansible.builtin.set_fact: openshift_console_url: "https://{{ console_url.stdout }}" -- name: | - TEST Check OpenShift Console URL is accessible - RHOSO-13626 +- name: "UI-1 Check OpenShift Console URL is accessible" ansible.builtin.shell: cmd: | curl -o /dev/null -s -w "%{http_code}" -k {{ openshift_console_url }}