Skip to content

Commit 86adbaa

Browse files
committed
[common] Update manifest role and config
* Use a list of strings, instead of a space-separated string * Remove the string separating tasks * Replace `wc -l` with stdout_lines | length * Name the loop var
1 parent 300a272 commit 86adbaa

File tree

3 files changed

+8
-21
lines changed

3 files changed

+8
-21
lines changed

ci/logging_tests_controller.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@
4646

4747
common_manifest_test_id: "RHOSO-12677"
4848
common_manifest_list:
49-
- "loki-operator 2"
50-
- "loki-helm-operator 1"
51-
49+
- ["loki-operator", "2"]
50+
- ["loki-helm-operator", "1"]
5251
common_service_test_id: "RHOSO-12675"
5352
common_service_nspace: openshift-logging
5453
common_service_list:

roles/common/tasks/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
- common_manifest_list is defined
4545
ansible.builtin.include_tasks: "manifest_tests.yml"
4646
loop: "{{ common_manifest_list }}"
47+
loop_control:
48+
loop_var: manifest
4749

4850
- name: "Run crd tests"
4951
when:
Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
---
2-
- name: Get number of packages
3-
ansible.builtin.shell:
4-
cmd: |
5-
echo "{{ item }}" | awk '{print $2;}'
6-
register: num_expected
7-
changed_when: false
8-
9-
- name: Get package name
10-
ansible.builtin.shell:
11-
cmd: |
12-
echo "{{ item }}" | awk '{print $1;}'
13-
register: pack_name
14-
changed_when: false
15-
162
- name: |
17-
TEST Get {{ item }} packagemanifest
3+
TEST Get {{ manifest[0] }} {{ manifest[1] }} packagemanifest
184
ansible.builtin.shell:
195
cmd: |
20-
oc get packagemanifests | grep "{{ pack_name.stdout }}" | wc -l
21-
register: num_found
6+
oc get packagemanifests | grep "{{ manifest[0] }}"
7+
register: num_found
228
changed_when: false
23-
failed_when: num_expected.stdout != num_found.stdout
9+
failed_when: manifest[1] | int != num_found.stdout_lines | length

0 commit comments

Comments
 (0)