From b279ca55a33cb46597c0047ef5ea97ada73a6610 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 11 Aug 2021 14:07:04 -0600 Subject: [PATCH] lf_qa.py : added the kpi_chart data, need to label with test tag Signed-off-by: Chuck SmileyRekiere --- py-scripts/sandbox/lf_qa.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/py-scripts/sandbox/lf_qa.py b/py-scripts/sandbox/lf_qa.py index 6fa64c03..f202aa7f 100755 --- a/py-scripts/sandbox/lf_qa.py +++ b/py-scripts/sandbox/lf_qa.py @@ -146,7 +146,29 @@ class csv_sqlite_dash(): return suite_html_results - + def get_kpi_chart_html(self): + kpi_chart_html = """ + + + """ + path = Path(self.path) + kpi_chart_list= list(path.glob('**/kpi-chart*.png')) # Hard code for now + print("kpi_chart_png_list {}".format(kpi_chart_list)) + for kpi_chart in kpi_chart_list: + kpi_chart = os.path.abspath(kpi_chart) # Path returns a list of objects + kpi_chart = self.server + kpi_chart.replace('/home/lanforge/','') + kpi_chart_html += """ + + + + """.format(kpi_chart,kpi_chart,kpi_chart) + + kpi_chart_html += """
+ + + +
""" + return kpi_chart_html # information on sqlite database # https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_sql.html @@ -458,6 +480,14 @@ Example: kpi_csv_sq.py --store --png --show --path (read report.set_custom_html(suite_html) report.build_custom() + # png summary of test + report.set_table_title("Suite Summary") + report.build_table_title() + kpi_chart_html = csv_dash.get_kpi_chart_html() + report.set_custom_html(kpi_chart_html) + report.build_custom() + + report.set_table_title("QA Test Results") report.build_table_title() # report.set_text("lanforge-scripts git sha: {}".format(git_sha))