Skip to content

Commit d8f86c8

Browse files
kstrenkovadanpawlik
authored andcommitted
Allow setting concurrency in 'stages' loop
Currently, it is not possible to set concurrency using the 'stages' functionality. It is because the retyping to string is present and concurrency is supposed to be type integer. This patch fixes this bug and lets users to set the value of the parameter.
1 parent a6bdcb6 commit d8f86c8

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

ansible.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ fact_caching_timeout = 0
1818
inventory = inventory.yml
1919
pipelining = True
2020
any_errors_fatal = True
21+
jinja2_native = True
2122
[ssh_connection]
2223
ssh_args = -o ControlMaster=auto -o ControlPersist=300

roles/test_operator/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Execute tests via the [test-operator](https://openstack-k8s-operators.github.io/
99
* `cifmw_test_operator_bundle`: (String) Full name of container image with bundle that contains the test-operator. Default value: `""`
1010
* `cifmw_test_operator_timeout`: (Integer) Timeout in seconds for the execution of the tests. Default value: `3600`
1111
* `cifmw_test_operator_logs_image`: (String) Image that should be used to collect logs from the pods spawned by the test-operator. Default value: `quay.io/quay/busybox`
12-
* `cifmw_test_operator_concurrency`: (Integer) Tempest concurrency value. As of now this value can not be specified inside `test_vars`. Default value: `8`
12+
* `cifmw_test_operator_concurrency`: (Integer) Tempest concurrency value. Default value: `8`
1313
* `cifmw_test_operator_cleanup`: (Bool) Delete all resources created by the role at the end of the testing. Default value: `false`
1414
* `cifmw_test_operator_tempest_cleanup`: (Bool) Run tempest cleanup after test execution (tempest run) to delete any resources created by tempest that may have been left out.
1515
* `cifmw_test_operator_default_groups`: (List) List of groups in the include list to search for tests to be executed. Default value: `[ 'default' ]`

roles/test_operator/defaults/main.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ cifmw_test_operator_controller_namespace: openstack-operators
2929
cifmw_test_operator_bundle: ""
3030
cifmw_test_operator_timeout: 3600
3131
cifmw_test_operator_logs_image: quay.io/quay/busybox
32-
cifmw_test_operator_concurrency: 8
3332
cifmw_test_operator_cleanup: false
3433
cifmw_test_operator_dry_run: false
3534
cifmw_test_operator_default_groups:
@@ -140,7 +139,7 @@ cifmw_test_operator_tempest_config:
140139
{{ stage_vars_dict.cifmw_test_operator_tempest_exclude_list | default('') }}
141140
expectedFailuresList: |
142141
{{ stage_vars_dict.cifmw_test_operator_tempest_expected_failures_list | default('') }}
143-
concurrency: "{{ cifmw_test_operator_concurrency }}"
142+
concurrency: "{{ stage_vars_dict.cifmw_test_operator_concurrency | default(8) }}"
144143
externalPlugin: "{{ stage_vars_dict.cifmw_test_operator_tempest_external_plugin | default([]) }}"
145144
extraRPMs: "{{ stage_vars_dict.cifmw_test_operator_tempest_extra_rpms | default([]) }}"
146145
extraImages: "{{ stage_vars_dict.cifmw_test_operator_tempest_extra_images | default([]) }}"

roles/test_operator/tasks/stages.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@
3535
start_with: cifmw_test_operator_{{ _stage_vars.type }}
3636
when: item.key.startswith(start_with)
3737
ansible.builtin.set_fact:
38-
stage_vars_dict: "{{ stage_vars_dict | combine({item.key: _stage_test_vars[item.key] | default(lookup('vars', item.key, default=omit))} ) }}"
38+
stage_vars_dict: "{{ stage_vars_dict | combine({item.key: _stage_test_vars[item.key] | default(lookup('vars', item.key, default=omit)) }) }}"
39+
40+
- name: Overwrite concurrency in global_vars
41+
ansible.builtin.set_fact:
42+
stage_vars_dict: "{{ stage_vars_dict | combine({'cifmw_test_operator_concurrency': _stage_test_vars.cifmw_test_operator_concurrency | default(lookup('vars', 'concurrency', default=omit)) }) }}"
3943

4044
- name: Override specific type config
4145
vars:

0 commit comments

Comments
 (0)