Esempio n. 1
0
 public static string CodecoverageLine(int productId, Build build, AutomationTask task)
 {
     if (productId == 3)//Data Protection Search
     {
         return "<a href=\"http://10.98.26.221/api/" + build.Number + "\" style=\"color:#43c1d7; text-decoration:underline;\">Detail</a>";
     }
     else if (productId == 2)//CIS
     {
         return "<a href=\"http://10.98.28.192:8080/" + task.TaskId + "/" + task.GetJobs().First().JobId + "/coverage" + "\" style=\"color:#43c1d7; text-decoration:underline;\">Detail</a>";
     }
     return "TBD";
 }
Esempio n. 2
0
 /// <summary>
 /// Check whether all the jobs has been finished or not of the task
 /// 1. The 
 /// </summary>
 /// <param name="task"></param>
 /// <returns></returns>
 private static bool AreAllJobsOfTaskFinished(AutomationTask task)
 {
     List<AutomationJob> jobs = task.GetJobs();
     if (jobs == null || jobs.Count() <= 0)
     {
         ATFEnvironment.Log.logger.Warn("No jobs for Task " + task.TaskId.ToString());
         task.SetTaskStatus(TaskStatus.Failed);
         ATFEnvironment.Log.logger.Info("Change Task " + task.TaskId.ToString() + " status from Dispatched to Failed");
         task.AddProgressInformation("Change status: Dispatched to " + "Failed");
         return true;
     }
     else
     {
         foreach (AutomationJob job in jobs)
         {
             if (job.Status != (int)JobStatus.End
                 && job.Status != (int)JobStatus.Failed
                 && job.Status != (int)JobStatus.Complete
                 && job.Status != (int)JobStatus.Cancelled
                 && job.Status != (int)JobStatus.Timeout)
             {
                 return false;
             }
         }
         return true;
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Check whether one of the job has been started of the task
 /// </summary>
 /// <param name="task">task</param>
 /// <returns></returns>
 private static bool IsOneJobOfTaskStarted(AutomationTask task)
 {
     List<AutomationJob> jobs = task.GetJobs();
     if (jobs == null || jobs.Count() <= 0)
     {
         ATFEnvironment.Log.logger.Warn("No jobs for Task " + task.TaskId.ToString());
         task.SetTaskStatus(TaskStatus.Failed);
         ATFEnvironment.Log.logger.Info("Change Task " + task.TaskId.ToString() + " status from Dispatched to Failed");
         task.AddProgressInformation("Change status: Dispatched to " + "Failed");
         return false;
     }
     else
     {
         foreach (AutomationJob job in jobs)
         {
             if (job.Status != (int)JobStatus.Assigned)//The initial status of job
             {
                 return true;
             }
         }
         return false;
     }
 }