|
10 | 10 | failed_when: |
11 | 11 | - result.rc != 0 |
12 | 12 |
|
13 | | - # This is added so that the test is not included when it shouldn't be |
14 | | - # If the when is added to the test task, the resulting task name in |
15 | | - # XML is "verify_that_the_item_kind__item_name_cr_is_item_condition" |
16 | | - # Which might be okay, if polarion ignores the unknown testcases |
17 | | - # If polarion is ignoring the unknown testcases, then we don't need to |
18 | | - # mark anything with a test prefix |
19 | | -- name: Determine whether to mark the CR ready test as a test |
| 13 | + # This is added so that the test is not marked when it shouldn't be |
| 14 | + # If the item.condition_type is referenced in the TEST task, without |
| 15 | + # being defined, the resulting task name in XML is |
| 16 | + # "verify_that_the_item_kind_item_name_cr_is_item_condition_type" |
| 17 | +- name: Set the condition type |
20 | 18 | ansible.builtin.set_fact: |
21 | | - run_cr_ready_test: true |
22 | | - when: |
23 | | - - common_cr_ready_test_id is defined |
24 | | - - item.condition_type is defined |
| 19 | + condition_type: "{{ item.condition_type if item.condition_type is defined else '' }}" |
25 | 20 |
|
26 | 21 | - name: | |
27 | | - {{ 'TEST' if run_cr_ready_test | bool }} Verify that the {{ item.kind }} {{ item.name }} CR is {{ item.condition_type }} |
28 | | - {{ common_cr_ready_test_id }} |
| 22 | + {{ 'TEST' if condition_type | length > 0 }} Verify that the {{ item.kind }} {{ item.name }} CR is {{ condition_type }} |
| 23 | + {{ common_cr_ready_test_id if condition_type | length > 0 }} |
29 | 24 | ansible.builtin.command: |
30 | 25 | cmd: | |
31 | | - oc get {{ item.kind }} {{ item.name }} -o jsonpath='{.status.conditions[?(@.type=="{{ item.condition_type }}")].status}{"\n"}' |
| 26 | + oc get {{ item.kind }} {{ item.name }} -o jsonpath='{.status.conditions[?(@.type=="{{ condition_type }}")].status}{"\n"}' |
32 | 27 | register: result |
33 | 28 | changed_when: false |
34 | 29 | failed_when: |
|
0 commit comments