From: Kyr Shatskyy Date: Fri, 15 May 2020 20:48:47 +0000 (+0200) Subject: suite/build_matrix: get rid of '.yaml' in descriptions X-Git-Tag: 1.1.0~104^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F1482%2Fhead;p=teuthology.git suite/build_matrix: get rid of '.yaml' in descriptions Test descriptions have structured representation fragments the test config is composed from. It's worth noticing that no other files except yaml are used for description composition. Although having the .yaml extentions in the description looks redundant and has no use in the code. This change removes many '.yaml' sufixes from descriptions which make it more compact and easy to read. Signed-off-by: Kyr Shatskyy --- diff --git a/teuthology/suite/build_matrix.py b/teuthology/suite/build_matrix.py index 8efb2a8f9..2ae78a42b 100644 --- a/teuthology/suite/build_matrix.py +++ b/teuthology/suite/build_matrix.py @@ -185,7 +185,7 @@ def generate_combinations(path, mat, generate_from, generate_to): for i in range(generate_from, generate_to): output = mat.index(i) ret.append(( - matrix.generate_desc(combine_path, output), + matrix.generate_desc(combine_path, output).replace('.yaml', ''), matrix.generate_paths(path, output, combine_path))) return ret diff --git a/teuthology/suite/test/test_build_matrix.py b/teuthology/suite/test/test_build_matrix.py index d0476c346..504903692 100644 --- a/teuthology/suite/test/test_build_matrix.py +++ b/teuthology/suite/test/test_build_matrix.py @@ -637,9 +637,9 @@ class TestSubset(object): sub_max_facets, max_fanout, max_depth - 1, namegen, top=False) if subtree is not None: - tree[next(namegen)] = subtree + tree['d' + next(namegen)] = subtree else: - tree[yamilify(next(namegen))] = None + tree[yamilify('f' + next(namegen))] = None random.choice([ lambda: tree.update({'%': None}), lambda: None])() @@ -680,7 +680,12 @@ class TestSubset(object): ret += ('\t'*tabs) + (k + ':').ljust(10) + "\n" ret += pptree(v, tabs+1) return ret - for facet in flatten(tree): + def deyamlify(name): + if name.endswith('.yaml'): + return name[:-5] + else: + return name + for facet in (deyamlify(_) for _ in flatten(tree)): found = False for i in description_list: if facet in i: