| OLD | NEW |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import copy | 5 import copy |
| 6 import logging | 6 import logging |
| 7 import time | 7 import time |
| 8 | 8 |
| 9 from google.appengine.ext import ndb | 9 from google.appengine.ext import ndb |
| 10 | 10 |
| 11 from common import time_util | |
| 12 from common.http_client_appengine import HttpClientAppengine as HttpClient | 11 from common.http_client_appengine import HttpClientAppengine as HttpClient |
| 13 from common.pipeline_wrapper import BasePipeline | 12 from common.pipeline_wrapper import BasePipeline |
| 13 from lib import time_util |
| 14 from model import analysis_status | 14 from model import analysis_status |
| 15 from model.wf_swarming_task import WfSwarmingTask | 15 from model.wf_swarming_task import WfSwarmingTask |
| 16 from waterfall import swarming_util | 16 from waterfall import swarming_util |
| 17 from waterfall import waterfall_config | 17 from waterfall import waterfall_config |
| 18 | 18 |
| 19 | 19 |
| 20 def _GetSwarmingTaskName(ref_task_id): # pragma: no cover. | 20 def _GetSwarmingTaskName(ref_task_id): # pragma: no cover. |
| 21 """Returns a unique task name. | 21 """Returns a unique task name. |
| 22 | 22 |
| 23 Have this separate function in order to mock for testing purpose. | 23 Have this separate function in order to mock for testing purpose. |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 master_name, builder_name, build_number, step_name) | 158 master_name, builder_name, build_number, step_name) |
| 159 swarming_task.task_id = task_id | 159 swarming_task.task_id = task_id |
| 160 swarming_task.parameters['tests'] = tests | 160 swarming_task.parameters['tests'] = tests |
| 161 swarming_task.parameters['iterations_to_rerun'] = iterations_to_rerun | 161 swarming_task.parameters['iterations_to_rerun'] = iterations_to_rerun |
| 162 swarming_task.parameters['ref_name'] = swarming_util.GetTagValue( | 162 swarming_task.parameters['ref_name'] = swarming_util.GetTagValue( |
| 163 new_request.tags, 'ref_name') | 163 new_request.tags, 'ref_name') |
| 164 swarming_task.put() | 164 swarming_task.put() |
| 165 | 165 |
| 166 logging.info('A Swarming task was triggered:%s', task_id) | 166 logging.info('A Swarming task was triggered:%s', task_id) |
| 167 return task_id | 167 return task_id |
| OLD | NEW |