diff options
author | Tibor Frank <tifrank@cisco.com> | 2019-04-01 16:31:38 +0200 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2019-04-04 11:39:23 +0200 |
commit | d45c3f997201a6f17b39b3e5ceb82b332852149f (patch) | |
tree | 845236245b530243b178271d039160860704e1a9 /resources/tools/presentation/generator_tables.py | |
parent | ab635019fd3d5420a31fbd68c1549d0be2323104 (diff) |
Trending: Alerts
Change-Id: I1c744f4eeefe3082be02daa681bfc032d6db4d15
Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_tables.py')
-rw-r--r-- | resources/tools/presentation/generator_tables.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/resources/tools/presentation/generator_tables.py b/resources/tools/presentation/generator_tables.py index b55e4a545d..cdce5f98c0 100644 --- a/resources/tools/presentation/generator_tables.py +++ b/resources/tools/presentation/generator_tables.py @@ -858,6 +858,51 @@ def table_performance_trending_dashboard_html(table, input_data): return +def table_last_failed_tests(table, input_data): + """Generate the table(s) with algorithm: table_last_failed_tests + specified in the specification file. + + :param table: Table to generate. + :param input_data: Data to process. + :type table: pandas.Series + :type input_data: InputData + """ + + logging.info(" Generating the table {0} ...". + format(table.get("title", ""))) + + # Transform the data + logging.info(" Creating the data set for the {0} '{1}'.". + format(table.get("type", ""), table.get("title", ""))) + data = input_data.filter_data(table, continue_on_error=True) + + if data is None or data.empty: + logging.warn(" No data for the {0} '{1}'.". + format(table.get("type", ""), table.get("title", ""))) + return + + tbl_list = list() + for job, builds in table["data"].items(): + for build in builds: + build = str(build) + tbl_list.append(build) + tbl_list.append(input_data.metadata(job, build).get("version", "")) + for tst_name, tst_data in data[job][build].iteritems(): + if tst_data["status"] != "FAIL": + continue + groups = re.search(REGEX_NIC, tst_data["parent"]) + if not groups: + continue + nic = groups.group(0) + tbl_list.append("{0}-{1}".format(nic, tst_data["name"])) + + file_name = "{0}{1}".format(table["output-file"], table["output-file-ext"]) + logging.info(" Writing file: '{0}'".format(file_name)) + with open(file_name, "w") as file_handler: + for test in tbl_list: + file_handler.write(test + '\n') + + def table_failed_tests(table, input_data): """Generate the table(s) with algorithm: table_failed_tests specified in the specification file. |