def _get_links_for_failure(self): """Returns a named tuple of links related to this failure.""" links = collections.namedtuple('links', ('results,' 'status_log,' 'artifacts,' 'job,' 'test_history_url,' 'retry_url')) return links(reporting_utils.link_result_logs( self.job_id, self.result_owner, self.hostname), reporting_utils.link_status_log( self.job_id, self.result_owner, self.hostname), reporting_utils.link_build_artifacts(self.build), reporting_utils.link_job(self.job_id), reporting_utils.link_test_history(self.name), reporting_utils.link_retry_url(self.name))
def diagnose_job(self, job_id, instance_server): """Diagnose a suite job. Logs information about the jobs that are still to run in the suite. @param job_id: The id of the suite job to get information about. No meaningful information gets logged if the id is for a sub-job. @param instance_server: The instance server. Eg: cautotest, cautotest-cq, localhost. """ incomplete_jobs = self.rpc_interface.get_jobs( parent_job_id=job_id, summary=True, hostqueueentry__complete=False) if incomplete_jobs: logging.info('\n%s printing summary of incomplete jobs (%s):\n', JobTimer.format_time(datetime.now()), len(incomplete_jobs)) for job in incomplete_jobs: logging.info('%s: %s', job.testname[job.testname.rfind('/') + 1:], reporting_utils.link_job(job.id, instance_server)) else: logging.info('All jobs in suite have already completed.')
def summary(self): """Combines information about this bug into a summary string.""" template = ('This bug has been automatically filed to track the ' 'following issue:\n\n' 'Test: %(test)s.\n' 'Machine: %(machine)s.\n' 'Issue: It is suspected that the test has put the ' 'machine in the Repair Failed State.\n' 'Suggested Actions: Investigate to determine if this ' 'test is at fault and then either fix or disable the ' 'test if appropriate.\n' 'Job link: %(job)s.\n') disclaimer = ( '\n\nNote that the autofiled count on this bug indicates ' 'the number of times we have attempted to repair the ' 'machine, not the number of times it has gone into ' 'the repair failed state.\n') specifics = { 'test': self._test_name, 'machine': self._machine, 'job': reporting_utils.link_job(self._job_id), } return template % specifics + disclaimer