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
26 LOG_BASE_URL = 'http://%s/tko/retrieve_logs.cgi?job=/results/' % AUTOTEST_SERVER
32 # Add some buffer before and after job start/end time when searching for special
33 # tasks. This is to guarantee to include reset before the job starts and repair
34 # and cleanup after the job finishes.
49 @return: A dictionary as the history entry of given job/task.
64 """Return a list of dictionaries of select job/task's history.
133 @param job_id: ID of the test job that's related to the special task.
137 Job id. Note that, None means the cache is not available.
175 @param job_id: ID of the test job that's related to the special task.
178 @return: The list of special tasks that are related to the job id.
185 task.queue_entry.job.id == job_id]
189 """Information of a test job
196 @param hqe: HostQueueEntry of the job.
198 @param suite_start_time: Start time of the suite job, default is
200 @param suite_end_time: End time of the suite job, default is
203 # AFE job ID
204 self.id = hqe.job.id
205 # AFE job model
206 self.job = hqe.job
207 # Name of the job, strip all build and suite info.
208 self.name = hqe.job.name.split('/')[-1]
212 self.tko_job = tko_models.Job.objects.filter(afe_job_id=self.id)[0]
219 # The test job was never started.
232 self.log_url = JOB_URL % {'job_id': hqe.job.id, 'owner': hqe.job.owner,
242 """Get special tasks ran before and after the test job.
244 @param hqe: HostQueueEntry of the job.
246 @param suite_start_time: Start time of the suite job, default is
248 @param suite_end_time: End time of the suite job, default is
251 # Special tasks run before job starts.
253 # Special tasks run after job finished.
257 # that indicates the test job might not be started.
261 # Assume special tasks for the test job all start within 2 hours
262 # before the test job starts or 2 hours after the test finishes. In most
264 # test job starts and after test job finishes.
283 task.queue_entry.job.id == self.id]
294 """Get the history of a test job.
296 @return: A list of special tasks and test job information.
308 """Get a formatted string of the details of the job info.
324 """Information of a suite job
330 @param hqe: HostQueueEntry of the job.
332 # AFE job ID
333 self.id = hqe.job.id
334 # AFE job model
335 self.job = hqe.job
336 # Name of the job, strip all build and suite info.
337 self.name = hqe.job.name.split('/')[-1]
340 self.log_url = JOB_URL % {'job_id': hqe.job.id, 'owner': hqe.job.owner,
343 hqe = models.HostQueueEntry.objects.filter(job_id=hqe.job.id)[0]
354 for job in models.Job.objects.filter(parent_job_id=self.id):
356 job_hqe = models.HostQueueEntry.objects.filter(job_id=job.id)[0]
364 """Get the history of a suite job.
366 @return: A list of special tasks and test job information that has
367 suite job as the parent job.
370 for job in sorted(self.test_jobs,
372 history.extend(job.get_history())
377 """Get a formatted string of the details of the job info.
380 for job in self.test_jobs:
381 result += str(job)
387 """Get the history of a job.
389 @param job_id: ID of the job.
390 @return: A TestJobInfo object that contains the test job and its special
391 tasks' start/end time, if the job is a test job. Otherwise, return
392 a SuiteJobInfo object if the job is a suite job.
393 @raise Exception: if the test job can't be found in database.
398 raise Exception('No HQE found for job ID %d' % job_id)
409 The script accepts a job ID and print out the test job and its special