Skip to content

Commit

Permalink
Merge pull request #223 from xtrusia/main
Browse files Browse the repository at this point in the history
Support dictionary type of bundle list
  • Loading branch information
dosaboy authored Sep 5, 2024
2 parents 46f97c5 + 97e2a48 commit eb3376e
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions openstack/tools/identify_charm_func_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,24 @@
CLASSIC_TESTS_YAML = 'tests/tests.yaml'
REACTIVE_TESTS_YAML = os.path.join('src', CLASSIC_TESTS_YAML)

def extract_values(bundle_list):
extracted = []
for item in bundle_list:
if isinstance(item, dict):
extracted.append(list(item.values())[0])
else:
extracted.append(item)
return extracted

if os.path.exists(REACTIVE_TESTS_YAML):
bundles = yaml.safe_load(open(REACTIVE_TESTS_YAML))
else:
bundles = yaml.safe_load(open(CLASSIC_TESTS_YAML))

targets = set(bundles['smoke_bundles'] + bundles['gate_bundles'] +
bundles['dev_bundles'])
smoke_bundles = extract_values(bundles['smoke_bundles'])
gate_bundles = extract_values(bundles['gate_bundles'])
dev_bundles = extract_values(bundles['dev_bundles'])

targets = set(smoke_bundles + gate_bundles + dev_bundles)

print(' '.join(sorted(targets)))

0 comments on commit eb3376e

Please sign in to comment.