Skip to content

Commit

Permalink
[common] Update task names for XML reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
elfiesmelfie committed Dec 4, 2024
1 parent 5236d74 commit 6f950c0
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 24 deletions.
4 changes: 3 additions & 1 deletion roles/common/tasks/container_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 7 additions & 2 deletions roles/common/tasks/cr_tests.yml
Original file line number Diff line number Diff line change
@@ -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 }}
Expand All @@ -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"}'
Expand Down
6 changes: 4 additions & 2 deletions roles/common/tasks/crd_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
fail_msg: "CRD {{ item }} not found. Error: {{ output.stderr }}"
6 changes: 4 additions & 2 deletions roles/common/tasks/endpoint_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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] }} "
fail_msg: "The endpoint for service {{ item[0] }} "
6 changes: 4 additions & 2 deletions roles/common/tasks/manifest_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
failed_when: num_expected.stdout != num_found.stdout
4 changes: 3 additions & 1 deletion roles/common/tasks/pod_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
6 changes: 4 additions & 2 deletions roles/common/tasks/project_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
fail_msg: "project {{ item }} not found. Error: {{ output.stderr }}"
6 changes: 4 additions & 2 deletions roles/common/tasks/subscription_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
fail_msg: "subscription {{ item }} not found. Error: {{ output.stderr }}"
10 changes: 3 additions & 7 deletions roles/telemetry_graphing/tasks/cypress_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 1 addition & 3 deletions roles/telemetry_graphing/tasks/verify_url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 6f950c0

Please sign in to comment.