Example #1
0
  def RunImpl(self, run_try_job_params):
    if self.GetCallbackParameters().get('try_job_id'):
      # For idempotent operation.
      logging.warning('RunImpl invoked again after try job is scheduled.')
      return

    try_job_id = test_try_job.ScheduleTestTryJob(run_try_job_params,
                                                 self.pipeline_id)
    if not try_job_id:
      # Retry upon failure.
      raise pipeline.Retry('Failed to schedule a try job for %s/%s/%d.' %
                           run_try_job_params.build_key.GetParts())

    self.SaveCallbackParameters({'try_job_id': try_job_id})
Example #2
0
    def RunImpl(self, run_try_job_params):
        if self.GetCallbackParameters().get('try_job_id'):
            # For idempotent operation.
            logging.warning(
                'RunImpl invoked again after try job is scheduled.')
            return

        try_job_id = flake_try_job.ScheduleFlakeTryJob(run_try_job_params,
                                                       self.pipeline_id)
        if not try_job_id:
            raise pipeline.Retry(
                'Failed to schedule a flake try job at revision {}'.format(
                    run_try_job_params.revision))

        self.SaveCallbackParameters({'try_job_id': try_job_id})
  def RunImpl(self, run_swarming_task_params):
    if self.GetCallbackParameters().get('task_id'):
      # For idempotent operation.
      logging.warning('RunImpl invoked again after swarming task is triggered.')
      return

    task_id = test_swarming.TriggerSwarmingTask(run_swarming_task_params,
                                                self.pipeline_id)
    if not task_id:
      # Retry upon failure.
      master_name, builder_name, build_number = (
          run_swarming_task_params.build_key.GetParts())
      raise pipeline.Retry(
          'Failed to schedule a swarming task for %s/%s/%d/%s.' %
          (master_name, builder_name, build_number,
           run_swarming_task_params.step_name))

    self.SaveCallbackParameters({'task_id': task_id})
Example #4
0
    def RunImpl(self, pipeline_parameters):
        if self.GetCallbackParameters().get('task_id'):
            # For idempotent operation.
            logging.warning(
                'RunImpl invoked again after swarming task was already triggered.'
            )
            return

        task_id = flake_swarming.TriggerSwarmingTask(
            master_name=pipeline_parameters.master_name,
            builder_name=pipeline_parameters.builder_name,
            reference_build_number=pipeline_parameters.reference_build_number,
            step_name=pipeline_parameters.step_name,
            test_name=pipeline_parameters.test_name,
            isolate_sha=pipeline_parameters.isolate_sha,
            iterations=pipeline_parameters.iterations,
            timeout_seconds=pipeline_parameters.timeout_seconds,
            runner_id=self.pipeline_id)

        if not task_id:
            # Retry upon failure.
            raise pipeline.Retry('Failed to schedule a swarming task')

        self.SaveCallbackParameters({'task_id': task_id})