Skip to content

Commit f67ae9b

Browse files
[test_operator] Support merging skiplist with exclude list
Adding cifmw_test_operator_tempest_exclude_list_merge variable to enable combining list_skipped.yml with cifmw_test_operator_tempest_exclude_list. When set to true, both sources are merged into a single exclude list, which helps to later remove workarounds that merged these lists manually. Signed-off-by: Katarina Strenkova kstrenko@redhat.com
1 parent 81950e0 commit f67ae9b

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

roles/test_operator/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/
5555
* `cifmw_test_operator_tempest_container`: (String) Name of the tempest container. Default value: `openstack-tempest-all`
5656
* `cifmw_test_operator_tempest_debug`: (Bool) Run Tempest in debug mode, it keeps the operator pod sleeping infinity (it must only set to `true`only for debugging purposes). Default value: `false`
5757
* `cifmw_test_operator_tempest_exclude_list`: (String) List of tests to be skipped. Setting this will not use the `list_skipped` plugin. Default value: `''`
58+
* `cifmw_test_operator_tempest_exclude_list_merge`: (Bool) When set to true, merges tests from both `list_skipped.yml` and `cifmw_test_operator_tempest_exclude_list` into a single combined exclusion list. Default value: `false`
5859
* `cifmw_test_operator_tempest_expected_failures_list`: (String) List of tests for which failures will be ignored. Default value: `''`
5960
* `cifmw_test_operator_tempest_external_plugin`: (List) List of dicts describing any external plugin to be installed. The dictionary contains a repository, changeRepository (optional) and changeRefspec (optional). Default value: `[]`
6061
* `cifmw_test_operator_tempest_extra_configmaps_mounts`: WARNING: This parameter will be deprecated! Please use `cifmw_test_operator_tempest_extra_mounts` parameter instead. (List) A list of configmaps that should be mounted into the tempest test pods. Default value: `[]`

roles/test_operator/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ cifmw_test_operator_tempest_image_tag: "{{ cifmw_test_operator_default_image_tag
7575
cifmw_test_operator_tempest_network_attachments: []
7676
cifmw_test_operator_tempest_tests_include_override_scenario: false
7777
cifmw_test_operator_tempest_tests_exclude_override_scenario: false
78+
cifmw_test_operator_tempest_exclude_list_merge: false
7879
cifmw_test_operator_tempest_workflow: []
7980
cifmw_test_operator_tempest_cleanup: false
8081
cifmw_test_operator_tempest_rerun_failed_tests: false

roles/test_operator/tasks/tempest-tests.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
- name: Configuring tests to be skipped via skiplist
5252
when: >
5353
stage_vars_dict.cifmw_test_operator_tempest_exclude_list is not defined or
54+
stage_vars_dict.cifmw_test_operator_tempest_exclude_list_merge | bool or
5455
stage_vars_dict.cifmw_test_operator_tempest_tests_exclude_override_scenario | bool
5556
block:
5657
- name: Copy list_skipped to artifacts dir
@@ -66,10 +67,19 @@
6667
register:
6768
list_skipped
6869

69-
- name: Set variable
70+
- name: Merge tests from exclude list when merge is enabled
71+
when:
72+
- stage_vars_dict.cifmw_test_operator_tempest_exclude_list_merge | bool
73+
- stage_vars_dict.cifmw_test_operator_tempest_exclude_list is defined
74+
- stage_vars_dict.cifmw_test_operator_tempest_exclude_list | trim | length > 0
75+
ansible.builtin.set_fact:
76+
test_names: "{{ test_names | default(list_skipped.skipped_tests) + [item] }}"
77+
loop: "{{ stage_vars_dict.cifmw_test_operator_tempest_exclude_list | trim | split('\n') }}"
78+
79+
- name: Convert list of tests to string to pass to test-operator
7080
vars:
7181
skipped_tests: |
72-
{% for item in list_skipped.skipped_tests %}
82+
{% for item in test_names | default(list_skipped.skipped_tests) %}
7383
{{ item }}
7484
{% endfor %}
7585
ansible.builtin.set_fact:

0 commit comments

Comments
 (0)