X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_cpta.py;h=923d56bf4252d3cd7941099f8071280c1f0085e2;hb=refs%2Fchanges%2F29%2F34729%2F2;hp=0bef38d82d1f0fc42ba1916348416e7f2be8b36c;hpb=575b935029aa496629f138d0e5f756921b64d1e6;p=csit.git diff --git a/resources/tools/presentation/generator_cpta.py b/resources/tools/presentation/generator_cpta.py index 0bef38d82d..923d56bf42 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: @@ -871,16 +878,23 @@ def _generate_all_charts(spec, input_data): if classification in (u"regression", u"outlier"): result = u"FAIL" - txt_file.write(f"{legend_str}regression in percentage ]") + txt_file.write(f"\n{legend_str}regression in percentage ]") file_name = \ f"{spec.cpta[u'output-file']}/progressions-{job_name}.txt" 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: @@ -891,7 +905,7 @@ def _generate_all_charts(spec, input_data): txt_file.write(f"{tst_name} [ {trend}M | " f"#{number} | {ltc}% ]\n") - txt_file.write(f"{legend_str}progression in percentage ]") + txt_file.write(f"\n{legend_str}progression in percentage ]") else: result = u"FAIL"