lf_report.py: added set_table_dataframe_from_csv lf_snp_test.py : generate html and pdf for snp

Signed-off-by: Chuck SmileyRekiere <chuck.smileyrekiere@candelatech.com>
This commit is contained in:
Chuck SmileyRekiere
2021-04-19 16:00:40 -06:00
parent 4bf50ad75d
commit 401c7b1fef
2 changed files with 19 additions and 8 deletions

View File

@@ -37,17 +37,17 @@ class lf_report():
#_path the report directory under which the report directories will be created. #_path the report directory under which the report directories will be created.
_path = "/home/lanforge/report-data", _path = "/home/lanforge/report-data",
_alt_path = "", _alt_path = "",
_results_dir_name = "LANforge_Test_Results", _date = "",
_output_format = 'html', # pass in on the write functionality, current not used
_dataframe="",
_title="LANForge Test Run Heading", _title="LANForge Test Run Heading",
_table_title="LANForge Table Heading", _table_title="LANForge Table Heading",
_graph_title="LANForge Graph Title", _graph_title="LANForge Graph Title",
_obj = "", _obj = "",
_obj_title = "", _obj_title = "",
_date="",
_output_html="outfile.html", _output_html="outfile.html",
_output_pdf="outfile.pdf", _output_pdf="outfile.pdf",
_results_dir_name = "LANforge_Test_Results",
_output_format = 'html', # pass in on the write functionality, current not used
_dataframe="",
_path_date_time=""): # this is where the final report is placed. _path_date_time=""): # this is where the final report is placed.
#other report paths, #other report paths,
@@ -126,7 +126,8 @@ class lf_report():
if self.date != "": if self.date != "":
self.date_time_directory = str(self.date) + str("_") + str(self.results_dir_name) self.date_time_directory = str(self.date) + str("_") + str(self.results_dir_name)
else: else:
self.date_time_directory = str(datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S_")).replace(':','-') + str(self.results_dir_name) self.date = str(datetime.datetime.now().strftime("%Y_%m_%d_%H_%M_%S")).replace(':','-')
self.date_time_directory = self.date + str("_") + str(self.results_dir_name)
#def set_date_time_directory(self,date_time_directory): #def set_date_time_directory(self,date_time_directory):
# self.date_time_directory = date_time_directory # self.date_time_directory = date_time_directory
@@ -158,7 +159,7 @@ class lf_report():
def set_date(self,_date): def set_date(self,_date):
self.date = _date self.date = _date
def set_dataframe(self,_dataframe): def set_table_dataframe(self,_dataframe):
self.dataframe = _dataframe self.dataframe = _dataframe
def set_custom_html(self,_custom_html): def set_custom_html(self,_custom_html):

View File

@@ -1644,7 +1644,7 @@ LANforge GUI what is displayed in the Column and how to access the value with cl
print("ap_dict: {}".format(ap_dict)) print("ap_dict: {}".format(ap_dict))
# Logging information # Logging information
report = lf_report() report = lf_report(_results_dir_name = "Scaling_and_Performance")
if args.csv_outfile != None: if args.csv_outfile != None:
current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime()) current_time = time.strftime("%m_%d_%Y_%H_%M_%S", time.localtime())
@@ -2434,15 +2434,25 @@ LANforge GUI what is displayed in the Column and how to access the value with cl
logg.info("Full test passed, all connections increased rx rate") logg.info("Full test passed, all connections increased rx rate")
########################################## ##########################################
# #
# Print out location of results # Build Results
# #
########################################## ##########################################
if args.csv_outfile != None: if args.csv_outfile != None:
logg.info("Report CSV: {}".format(csv_outfile)) logg.info("Report CSV: {}".format(csv_outfile))
logg.info("Report CSV Results: {}".format(csv_results)) logg.info("Report CSV Results: {}".format(csv_results))
report.set_title("Scaling And Performance")
report.build_banner()
report.set_table_title("Scaling And Performance Throught put")
report.build_table_title()
report.set_table_dataframe_from_csv(csv_results)
report.build_table()
report.write_html()
report.write_pdf()
if args.log: if args.log:
logg.info("output_log: {}".format(outfile_log)) logg.info("output_log: {}".format(outfile_log))
if __name__ == "__main__": if __name__ == "__main__":
main() main()