Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename tasks for XML reporting #181

Merged
merged 16 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ skip_list:
- command-instead-of-module # Using command rather than module
- galaxy
- meta-no-info # meta/main.yml should contain relevant info
- name[template] # Jinja templates should only be at the end of 'name'
- risky-shell-pipe # Shells that use pipes should set the pipefail option
- unnamed-task # All tasks should be named
- var-naming[no-role-prefix] # Variables names from within roles should use role_name_ as a prefix
Expand Down
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: |
TEST Verify {{ container_name }} container status
{{ common_container_test_id }}
ansible.builtin.assert:
that:
- "'unhealthy' not in container_status.stdout"
Expand Down
5 changes: 4 additions & 1 deletion 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 Down
4 changes: 3 additions & 1 deletion roles/common/tasks/crd_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
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"
Expand Down
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] }} {{ item[2] }} 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] }} on the {{ item[2] }} interface was not found"
2 changes: 1 addition & 1 deletion roles/common/tasks/file_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
register: fstats

- name: |
Verify the file {{ item }} exists
TEST Verify the file {{ item }} exists
{{ common_file_test_id }}
ansible.builtin.assert:
that:
Expand Down
2 changes: 1 addition & 1 deletion roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: "Verify pod - {{ common_pod_test_id }}"
- name: "Run pod tests"
when:
- common_pod_test_id is defined
- common_pod_list is defined
Expand Down
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 is {{ common_pod_status_str }} in {{ common_pod_nspace }} namespace
{{ 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
@@ -1,12 +1,14 @@
---
- name: Verify project "{{ item }}"
- name: Get the {{ item }} project
ansible.builtin.shell:
cmd: |
oc get project "{{ item }}"
changed_when: false
register: output

- name: Verify project is found "{{ common_project_test_id }}"
- name: |
TEST Verify {{ item }} project exists
{{ common_project_test_id }}
ansible.builtin.assert:
that:
- "'NotFound' not in output.stderr"
Expand Down
2 changes: 1 addition & 1 deletion roles/common/tasks/service_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
register: output

- name: |
Verify {{ item }} service is running
TEST Verify {{ item }} service is running in {{ common_service_nspace }} namespace
{{ common_service_test_id }}
ansible.builtin.assert:
that:
Expand Down
4 changes: 3 additions & 1 deletion roles/common/tasks/subscription_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
changed_when: false
register: output

- name: Check that subscription exist {{ common_subscription_test_id }}
- name: |
TEST Check that {{ item }} subscription exists in {{ common_subscription_nspace }} namespace
{{ common_subscription_test_id }}
ansible.builtin.assert:
that:
- "'NotFound' not in output.stderr"
Expand Down
2 changes: 1 addition & 1 deletion roles/telemetry_logging/tasks/journal_tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: |
Get journals {{ item }}
TEST Get journals {{ item }}
{{ journal_test_id }}
become: true
ansible.builtin.shell:
Expand Down