From adbfa281ba4c5dc31a8b39abe552bda2083cf05c Mon Sep 17 00:00:00 2001 From: Cleber Rosa Date: Wed, 15 May 2019 16:53:20 -0400 Subject: [PATCH] List: add support for values in tags When listing tests in verbose mode, tags get shown. But since the addition of key:val tags, the values are not being shown. To allow for a compact layout, this puts the values under parenthesis right after the key. Signed-off-by: Cleber Rosa --- avocado/plugins/list.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/avocado/plugins/list.py b/avocado/plugins/list.py index 56ed21a3..9d79cf07 100644 --- a/avocado/plugins/list.py +++ b/avocado/plugins/list.py @@ -75,14 +75,19 @@ class TestLister: if 'tags' in params: tags = params['tags'] else: - tags = set() - for tag in tags: + tags = {} + tags_repr = [] + for tag, vals in tags.items(): if tag not in tag_stats: tag_stats[tag] = 1 else: tag_stats[tag] += 1 - tags = ",".join(tags) - test_matrix.append((type_label, params['name'], tags)) + if vals: + tags_repr.append("%s(%s)" % (tag, ",".join(vals))) + else: + tags_repr.append(tag) + tags_repr = ",".join(tags_repr) + test_matrix.append((type_label, params['name'], tags_repr)) else: test_matrix.append((type_label, params['name'])) -- GitLab