From fd8cf5ebaa4ef209b20889f43f4668d57f5e8cbe Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 11 Aug 2021 14:58:55 -0600 Subject: [PATCH] lf_qa.py : added test_tag to the summary of results Signed-off-by: Chuck SmileyRekiere --- py-scripts/sandbox/lf_qa.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/py-scripts/sandbox/lf_qa.py b/py-scripts/sandbox/lf_qa.py index cecd11e4..13053acd 100755 --- a/py-scripts/sandbox/lf_qa.py +++ b/py-scripts/sandbox/lf_qa.py @@ -95,6 +95,17 @@ class csv_sqlite_dash(): parent_path = os.path.dirname(_path) return parent_path + def get_test_tag(self,_kpi_path): + test_tag = "NA" + try: + kpi_df = pd.read_csv(_kpi_path, sep='\t') + test_tag_list = list(kpi_df['test-tag']) + test_tag = list(set(test_tag_list)) + test_tag = test_tag[-1] # done to get element of list + except: + print("exception reading csv _kpi_path {}".format(_kpi_path)) + return test_tag + #TODO pass in list to lf_report # def get_suite_html(self): @@ -103,15 +114,16 @@ class csv_sqlite_dash(): + @@ -135,9 +147,11 @@ class csv_sqlite_dash(): html_path = os.path.join(parent_path,"index.html") html_path = self.server + html_path.replace('/home/lanforge/','') base_name = os.path.basename(parent_path) + kpi_path = os.path.join(parent_path,"kpi.csv") + test_tag = self.get_test_tag(kpi_path) suite_html_results += """ -

- """.format(base_name,html_path,pdf_path) +

+ """.format(base_name,test_tag,html_path,pdf_path) suite_html_results += """
TestTest_Tag Links

{}

html / pdf

{}

{}

html / pdf
@@ -153,7 +167,6 @@ class csv_sqlite_dash(): """ 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/','')