Skip to content

Commit 50dee14

Browse files
committed
[telemetry_chargeback] simplify test scenario list generation
1 parent 457734a commit 50dee14

2 files changed

Lines changed: 3 additions & 13 deletions

File tree

roles/telemetry_chargeback/defaults/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ openstack_cmd: "openstack"
66
cloudkitty_debug: false
77
cloudkitty_debug_dir: "{{ (cloudkitty_debug | bool) | ternary(artifacts_dir_zuul + '/debug_ck_db', '') }}"
88

9+
# Directory paths
910
logs_dir_zuul: "{{ cifmw_basedir }}/logs"
1011
artifacts_dir_zuul: "{{ cifmw_basedir }}/artifacts"
1112
cert_dir: "{{ cifmw_basedir }}/ck-certs"
@@ -29,4 +30,4 @@ lookback: 6
2930
limit: 50
3031

3132
# List of test scenario files to run
32-
cloudkitty_test_scenarios: []
33+
cloudkitty_test_scenarios: ["test_static.yml" , "test_dyn_basic.yml"]

roles/telemetry_chargeback/tasks/main.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,9 @@
55
- name: "Setup Loki Environment"
66
ansible.builtin.include_tasks: "setup_loki_env.yml"
77

8-
- name: "Find test files"
9-
ansible.builtin.find:
10-
paths: "{{ cloudkitty_scenario_dir }}"
11-
patterns: "test_*.yml"
12-
register: found_files_raw
13-
14-
- name: "Extract only the filenames into a clean list"
15-
ansible.builtin.set_fact:
16-
found_files: "{{ found_files_raw.files | map(attribute='path') | map('basename') | list }}"
17-
188
- name: "Determine which scenarios to run"
199
ansible.builtin.set_fact:
20-
scenarios_to_run: "{{ (cloudkitty_test_scenarios if cloudkitty_test_scenarios | length > 0 else found_files) | map('regex_replace', '\\.yml$', '') | list }}"
21-
10+
scenarios_to_run: "{{ cloudkitty_test_scenarios | map('regex_replace', '\\.yml$', '') | list }}"
2211

2312
- name: "Run scenario file through workflow"
2413
block:

0 commit comments

Comments
 (0)