diff --git a/.ansible-lint b/.ansible-lint index ff64212fa..9b67ffad5 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -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 diff --git a/roles/common/tasks/container_test.yml b/roles/common/tasks/container_test.yml index 71b84ac59..2ccfa0504 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: | + TEST 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 fcb646d7c..03d054238 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 }} diff --git a/roles/common/tasks/crd_tests.yml b/roles/common/tasks/crd_tests.yml index e618d2044..afbe89306 100644 --- a/roles/common/tasks/crd_tests.yml +++ b/roles/common/tasks/crd_tests.yml @@ -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" diff --git a/roles/common/tasks/endpoint_tests.yml b/roles/common/tasks/endpoint_tests.yml index cdea10ea2..b04b937ae 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] }} {{ 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] }} " \ No newline at end of file + fail_msg: "The endpoint for service {{ item[0] }} on the {{ item[2] }} interface was not found" diff --git a/roles/common/tasks/file_tests.yml b/roles/common/tasks/file_tests.yml index 7cf1af5c1..c56d86341 100644 --- a/roles/common/tasks/file_tests.yml +++ b/roles/common/tasks/file_tests.yml @@ -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: diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 21fcc337f..1993bc9d0 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -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 diff --git a/roles/common/tasks/manifest_tests.yml b/roles/common/tasks/manifest_tests.yml index 63e03aa72..48c4ab869 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 97e2b5b7c..e688c9fcd 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 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 }}" diff --git a/roles/common/tasks/project_tests.yml b/roles/common/tasks/project_tests.yml index 1d0be76e6..487961a7b 100644 --- a/roles/common/tasks/project_tests.yml +++ b/roles/common/tasks/project_tests.yml @@ -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" diff --git a/roles/common/tasks/service_tests.yml b/roles/common/tasks/service_tests.yml index a6505d66e..1a1fcf7e3 100644 --- a/roles/common/tasks/service_tests.yml +++ b/roles/common/tasks/service_tests.yml @@ -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: diff --git a/roles/common/tasks/subscription_tests.yml b/roles/common/tasks/subscription_tests.yml index 49f2b6db5..4b27530cd 100644 --- a/roles/common/tasks/subscription_tests.yml +++ b/roles/common/tasks/subscription_tests.yml @@ -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" diff --git a/roles/telemetry_logging/tasks/journal_tests.yml b/roles/telemetry_logging/tasks/journal_tests.yml index 1d27f2a4a..cb5e14b69 100644 --- a/roles/telemetry_logging/tasks/journal_tests.yml +++ b/roles/telemetry_logging/tasks/journal_tests.yml @@ -1,6 +1,6 @@ --- - name: | - Get journals {{ item }} + TEST Get journals {{ item }} {{ journal_test_id }} become: true ansible.builtin.shell: