def post_finish(self, status): """Extract the coverage results summary for the dashboard. If that fails for some reason, report the job as a failure. """ if self.dry_run or status != 'P': return results, self.cov_total, ex_msg = get_cov_summary_table( self.cov_report_txt, self.sim_cfg.tool) if ex_msg: self.launcher.fail_msg += ex_msg log.error(ex_msg) return # Succeeded in obtaining the coverage data. colalign = (("center", ) * len(results[0])) self.cov_results = tabulate(results, headers="firstrow", tablefmt="pipe", colalign=colalign) # Delete the cov report - not needed. rm_path(self.get_log_path())
def _test_passed(self): # Add an extra check to Deploy._test_passed where we extract the # coverage results summary for the dashboard (and fail the job if # something goes wrong). if not super()._test_passed(): return False results, self.cov_total, ex_msg = get_cov_summary_table( self.cov_report_txt, self.sim_cfg.tool) if ex_msg: self.fail_msg += ex_msg log.error(ex_msg) return False # Succeeded in obtaining the coverage data. colalign = (("center", ) * len(results[0])) self.cov_results = tabulate(results, headers="firstrow", tablefmt="pipe", colalign=colalign) # Delete the cov report - not needed. os.system("rm -rf " + self.log) return True
def post_finish(self, status): """Extract the coverage results summary for the dashboard. If the extraction fails, an appropriate exception is raised, which must be caught by the caller to mark the job as a failure. """ if self.dry_run or status != 'P': return results, self.cov_total = get_cov_summary_table( self.cov_report_txt, self.sim_cfg.tool) colalign = (("center", ) * len(results[0])) self.cov_results = tabulate(results, headers="firstrow", tablefmt="pipe", colalign=colalign)
def get_status(self): super().get_status() # Once passed, extract the cov results summary from the dashboard. if self.status == "P": results, self.cov_total, ex_msg = get_cov_summary_table( self.cov_report_txt, self.sim_cfg.tool) if not ex_msg: # Succeeded in obtaining the coverage data. colalign = (("center", ) * len(results[0])) self.cov_results = tabulate(results, headers="firstrow", tablefmt="pipe", colalign=colalign) else: self.fail_msg += ex_msg log.error(ex_msg) self.status = "F" if self.status == "P": # Delete the cov report - not needed. os.system("rm -rf " + self.log)