| 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 | 5 |
| 6 from recipe_engine import recipe_api | 6 from recipe_engine import recipe_api |
| 7 import shlex | 7 import shlex |
| 8 | 8 |
| 9 | 9 |
| 10 DEFAULT_TASK_EXPIRATION = 20*60*60 | 10 DEFAULT_TASK_EXPIRATION = 20*60*60 |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 swarming_task.idempotent = idempotent | 216 swarming_task.idempotent = idempotent |
| 217 swarming_task.priority = 90 | 217 swarming_task.priority = 90 |
| 218 swarming_task.expiration = ( | 218 swarming_task.expiration = ( |
| 219 expiration if expiration else DEFAULT_TASK_EXPIRATION) | 219 expiration if expiration else DEFAULT_TASK_EXPIRATION) |
| 220 swarming_task.hard_timeout = ( | 220 swarming_task.hard_timeout = ( |
| 221 hard_timeout if hard_timeout else DEFAULT_TASK_TIMEOUT) | 221 hard_timeout if hard_timeout else DEFAULT_TASK_TIMEOUT) |
| 222 swarming_task.io_timeout = ( | 222 swarming_task.io_timeout = ( |
| 223 io_timeout if io_timeout else DEFAULT_IO_TIMEOUT) | 223 io_timeout if io_timeout else DEFAULT_IO_TIMEOUT) |
| 224 if extra_args: | 224 if extra_args: |
| 225 swarming_task.extra_args = extra_args | 225 swarming_task.extra_args = extra_args |
| 226 revision = self.m.properties.get('revision') |
| 227 if revision: |
| 228 swarming_task.tags.add('revision:%s' % revision) |
| 226 swarming_tasks.append(swarming_task) | 229 swarming_tasks.append(swarming_task) |
| 227 step_results = self.m.swarming.trigger(swarming_tasks) | 230 step_results = self.m.swarming.trigger(swarming_tasks) |
| 228 for step_result in step_results: | 231 for step_result in step_results: |
| 229 self._add_log_links(step_result) | 232 self._add_log_links(step_result) |
| 230 return swarming_tasks | 233 return swarming_tasks |
| 231 | 234 |
| 232 def collect_swarming_task(self, swarming_task): | 235 def collect_swarming_task(self, swarming_task): |
| 233 """Collects the specified swarming task. | 236 """Collects the specified swarming task. |
| 234 | 237 |
| 235 Args: | 238 Args: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 else: | 279 else: |
| 277 for _, task in step_result.json.output.get('tasks', {}).iteritems(): | 280 for _, task in step_result.json.output.get('tasks', {}).iteritems(): |
| 278 ids.append(task['task_id']) | 281 ids.append(task['task_id']) |
| 279 for idx, task_id in enumerate(ids): | 282 for idx, task_id in enumerate(ids): |
| 280 link = MILO_LOG_LINK % task_id | 283 link = MILO_LOG_LINK % task_id |
| 281 k = 'view steps on Milo' | 284 k = 'view steps on Milo' |
| 282 if len(ids) > 1: # pragma: nocover | 285 if len(ids) > 1: # pragma: nocover |
| 283 k += ' (shard index %d, %d total)' % (idx, len(ids)) | 286 k += ' (shard index %d, %d total)' % (idx, len(ids)) |
| 284 step_result.presentation.links[k] = link | 287 step_result.presentation.links[k] = link |
| 285 | 288 |
| OLD | NEW |