Lines Matching full:job
6 # This module provides functions for caller to retrieve a job's history,
7 # including special tasks executed before and after the job, and each steps
22 LOG_BASE_URL = 'http://%s/tko/retrieve_logs.cgi?job=/results/' % AUTOTEST_SERVER
28 # Add some buffer before and after job start/end time when searching for special
29 # tasks. This is to guarantee to include reset before the job starts and repair
30 # and cleanup after the job finishes.
45 @return: A dictionary as the history entry of given job/task.
60 """Return a list of dictionaries of select job/task's history.
129 @param job_id: ID of the test job that's related to the special task.
133 Job id. Note that, None means the cache is not available.
171 @param job_id: ID of the test job that's related to the special task.
174 @return: The list of special tasks that are related to the job id.
181 task.queue_entry.job.id == job_id]
185 """Information of a test job
192 @param hqe: HostQueueEntry of the job.
194 @param suite_start_time: Start time of the suite job, default is
196 @param suite_end_time: End time of the suite job, default is
199 # AFE job ID
200 self.id = hqe.job.id
201 # AFE job model
202 self.job = hqe.job
203 # Name of the job, strip all build and suite info.
204 self.name = hqe.job.name.split('/')[-1]
208 self.tko_job = tko_models.Job.objects.filter(afe_job_id=self.id)[0]
215 # The test job was never started.
228 self.log_url = JOB_URL % {'job_id': hqe.job.id, 'owner': hqe.job.owner,
238 """Get special tasks ran before and after the test job.
240 @param hqe: HostQueueEntry of the job.
242 @param suite_start_time: Start time of the suite job, default is
244 @param suite_end_time: End time of the suite job, default is
247 # Special tasks run before job starts.
249 # Special tasks run after job finished.
253 # that indicates the test job might not be started.
257 # Assume special tasks for the test job all start within 2 hours
258 # before the test job starts or 2 hours after the test finishes. In most
260 # test job starts and after test job finishes.
279 task.queue_entry.job.id == self.id]
290 """Get the history of a test job.
292 @return: A list of special tasks and test job information.
304 """Get a formatted string of the details of the job info.
320 """Information of a suite job
326 @param hqe: HostQueueEntry of the job.
328 # AFE job ID
329 self.id = hqe.job.id
330 # AFE job model
331 self.job = hqe.job
332 # Name of the job, strip all build and suite info.
333 self.name = hqe.job.name.split('/')[-1]
336 self.log_url = JOB_URL % {'job_id': hqe.job.id, 'owner': hqe.job.owner,
339 hqe = models.HostQueueEntry.objects.filter(job_id=hqe.job.id)[0]
350 for job in models.Job.objects.filter(parent_job_id=self.id):
352 job_hqe = models.HostQueueEntry.objects.filter(job_id=job.id)[0]
360 """Get the history of a suite job.
362 @return: A list of special tasks and test job information that has
363 suite job as the parent job.
366 for job in sorted(self.test_jobs,
368 history.extend(job.get_history())
373 """Get a formatted string of the details of the job info.
376 for job in self.test_jobs:
377 result += str(job)
383 """Get the history of a job.
385 @param job_id: ID of the job.
386 @return: A TestJobInfo object that contains the test job and its special
387 tasks' start/end time, if the job is a test job. Otherwise, return
388 a SuiteJobInfo object if the job is a suite job.
389 @raise Exception: if the test job can't be found in database.
394 raise Exception('No HQE found for job ID %d' % job_id)
405 The script accepts a job ID and print out the test job and its special