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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion ci/logging_tests_computes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@
- nova_compute
tasks:
- name: "Run Telemetry Logging tests"
ansible.builtin.import_role:
ansible.builtin.include_role:
name: telemetry_logging
14 changes: 7 additions & 7 deletions ci/logging_tests_controller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
- openshift-logging
tasks:
- name: "Verify logging infrastructure components"
ansible.builtin.import_role:
ansible.builtin.include_role:
name: common

- name: "Verify logging pods are running in openstack"
Expand All @@ -43,7 +43,7 @@
- openstackclient
tasks:
- name: "Verify Running Pods"
ansible.builtin.import_role:
ansible.builtin.include_role:
name: common


Expand All @@ -62,7 +62,7 @@
- loki-operator-controller-manager
tasks:
- name: "Verify Pods running"
ansible.builtin.import_role:
ansible.builtin.include_role:
name: common

- name: "Verify logging pods are running in openshift-logging"
Expand Down Expand Up @@ -91,7 +91,7 @@
### see JIRA LOG-5431 if pods not running
tasks:
- name: "Verify Pods running"
ansible.builtin.import_role:
ansible.builtin.include_role:
name: common

- name: "Verify logging pods are running in minio-dev"
Expand All @@ -109,7 +109,7 @@
- minio
tasks:
- name: "Run pod running tests"
ansible.builtin.import_role:
ansible.builtin.include_role:
name: common


Expand All @@ -128,7 +128,7 @@
- logging-edpm-deployment-openstack-edpm-ipam
tasks:
- name: "Run pods completed tests"
ansible.builtin.import_role:
ansible.builtin.include_role:
name: common

- name: "Verify the crds exist"
Expand All @@ -147,5 +147,5 @@
- rulerconfigs.loki.grafana.com
tasks:
- name: "Run the crds tests"
ansible.builtin.import_role:
ansible.builtin.include_role:
name: common
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
elfiesmelfie marked this conversation as resolved.
Show resolved Hide resolved
{{ 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 {{ item.condition_type }}
{{ 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 is running in {{ common_pod_namespace }} namespace
{{ common_pod_test_id }}
ansible.builtin.command:
cmd: |
oc get pod -n "{{ common_pod_nspace }}" "{{ podinstance.stdout }}"
Expand Down
8 changes: 5 additions & 3 deletions roles/common/tasks/project_tests.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
- 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"
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 }}"
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
Loading