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 Nov 28, 2024
1 parent d24cfd4 commit 31c359f
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 14 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 }}"

0 comments on commit 31c359f

Please sign in to comment.