X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Ftools%2Fpresentation%2Fgenerator_tables.py;h=7590daa8fecd52fc1b409da979e62818ce942e73;hp=1bbe8e38d44c3c439772e6ff2c828c53437e539d;hb=c7790170533bd47ffc0e9001db92127356756c11;hpb=8853921639f749a0e49e37759df2b973947977e3 diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index 1bbe8e38d4..7590daa8fe 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -23,6 +23,8 @@ from string import replace from collections import OrderedDict from numpy import nan, isnan from xml.etree import ElementTree as ET +from datetime import datetime as dt +from datetime import timedelta from utils import mean, stdev, relative_change, classify_anomalies, \ convert_csv_to_pretty_txt @@ -240,11 +242,14 @@ def table_performance_comparison(table, input_data): replace("1t1c", "1c").replace("2t1c", "1c").\ replace("2t2c", "2c").replace("4t2c", "2c").\ replace("4t4c", "4c").replace("8t4c", "4c") + if "across topologies" in table["title"].lower(): + tst_name_mod = tst_name_mod.replace("2n1l-", "") if tbl_dict.get(tst_name_mod, None) is None: name = "{0}-{1}".format(tst_data["parent"].split("-")[0], "-".join(tst_data["name"]. split("-")[:-1])) - if "comparison across testbeds" in table["title"].lower(): + if "across testbeds" in table["title"].lower() or \ + "across topologies" in table["title"].lower(): name = name.\ replace("1t1c", "1c").replace("2t1c", "1c").\ replace("2t2c", "2c").replace("4t2c", "2c").\ @@ -286,6 +291,8 @@ def table_performance_comparison(table, input_data): replace("1t1c", "1c").replace("2t1c", "1c").\ replace("2t2c", "2c").replace("4t2c", "2c").\ replace("4t4c", "4c").replace("8t4c", "4c") + if "across topologies" in table["title"].lower(): + tst_name_mod = tst_name_mod.replace("2n1l-", "") try: # TODO: Re-work when NDRPDRDISC tests are not used if table["include-tests"] == "MRR": @@ -323,6 +330,8 @@ def table_performance_comparison(table, input_data): replace("1t1c", "1c").replace("2t1c", "1c").\ replace("2t2c", "2c").replace("4t2c", "2c").\ replace("4t4c", "4c").replace("8t4c", "4c") + if "across topologies" in table["title"].lower(): + tst_name_mod = tst_name_mod.replace("2n1l-", "") if tbl_dict.get(tst_name_mod, None) is None: continue if tbl_dict[tst_name_mod].get("history", None) is None: @@ -542,6 +551,9 @@ def _generate_url(base, testbed, test_name): if "lbdpdk" in test_name or "lbvpp" in test_name: file_name = "link_bonding" + elif "114b" in test_name and "vhost" in test_name: + file_name = "vts" + elif "testpmd" in test_name or "l3fwd" in test_name: file_name = "dpdk" @@ -555,7 +567,9 @@ def _generate_url(base, testbed, test_name): elif "vhost" in test_name: if "l2xcbase" in test_name or "l2bdbasemaclrn" in test_name: file_name = "vm_vhost_l2" - if "l2xcbase" in test_name: + if "114b" in test_name: + feature = "" + elif "l2xcbase" in test_name: feature = "-base-l2xc" elif "l2bdbasemaclrn" in test_name: feature = "-base-l2bd" @@ -753,6 +767,10 @@ def table_failed_tests(table, input_data): # Generate the data for the table according to the model in the table # specification + + now = dt.utcnow() + timeperiod = timedelta(int(table.get("window", 7))) + tbl_dict = dict() for job, builds in table["data"].items(): for build in builds: @@ -769,19 +787,24 @@ def table_failed_tests(table, input_data): "name": "{0}-{1}".format(nic, tst_data["name"]), "data": OrderedDict()} try: - tbl_dict[tst_name]["data"][build] = ( - tst_data["status"], - input_data.metadata(job, build).get("generated", ""), - input_data.metadata(job, build).get("version", ""), - build) + generated = input_data.metadata(job, build).\ + get("generated", "") + if not generated: + continue + then = dt.strptime(generated, "%Y%m%d %H:%M") + if (now - then) <= timeperiod: + tbl_dict[tst_name]["data"][build] = ( + tst_data["status"], + generated, + input_data.metadata(job, build).get("version", ""), + build) except (TypeError, KeyError): pass # No data in output.xml for this test tbl_lst = list() for tst_data in tbl_dict.values(): - win_size = min(len(tst_data["data"]), table["window"]) fails_nr = 0 - for val in tst_data["data"].values()[-win_size:]: + for val in tst_data["data"].values(): if val[0] == "FAIL": fails_nr += 1 fails_last_date = val[1]