From 6e42b7852dea95ad855ea24a762a6c856fd9c4c4 Mon Sep 17 00:00:00 2001 From: Viliam Luc Date: Tue, 14 Dec 2021 12:03:33 +0100 Subject: trending: fix broken trending Signed-off-by: Viliam Luc Change-Id: I1ecbfa48f3765884720f0490b9b9da1f69bd2b1a --- resources/tools/presentation/generator_cpta.py | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'resources/tools/presentation') diff --git a/resources/tools/presentation/generator_cpta.py b/resources/tools/presentation/generator_cpta.py index 0bef38d82d..2182fe90c2 100644 --- a/resources/tools/presentation/generator_cpta.py +++ b/resources/tools/presentation/generator_cpta.py @@ -855,9 +855,16 @@ def _generate_all_charts(spec, input_data): with open(file_name, u'w') as txt_file: for test_name, classification in job_data.items(): if classification == u"regression": - tst = test_name.split(" ")[1].split(".")[1:] - nic = tst[0].split("-")[0] - tst_name = f"{nic}-{tst[1]}" + if u"2n" in test_name: + test_name = test_name.split("-", 2) + tst = test_name[2].split(".")[-1] + nic = test_name[1] + tst_name = f"{nic}-{tst}" + else: + test_name = test_name.split("-", 1) + tst = test_name[1].split(".")[-1] + nic = test_name[0].split(".")[-1] + tst_name = f"{nic}-{tst}" for line in data: if tst_name in line: @@ -878,9 +885,16 @@ def _generate_all_charts(spec, input_data): with open(file_name, u'w') as txt_file: for test_name, classification in job_data.items(): if classification == u"progression": - tst = test_name.split(" ")[1].split(".")[1:] - nic = tst[0].split("-")[0] - tst_name = f"{nic}-{tst[1]}" + if u"2n" in test_name: + test_name = test_name.split("-", 2) + tst = test_name[2].split(".")[-1] + nic = test_name[1] + tst_name = f"{nic}-{tst}" + else: + test_name = test_name.split("-", 1) + tst = test_name[1].split(".")[-1] + nic = test_name[0].split(".")[-1] + tst_name = f"{nic}-{tst}" for line in data: if tst_name in line: -- cgit 1.2.3-korg