Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """Recipe module to ensure a checkout is consistant on a bot.""" | 6 """Recipe module to ensure a checkout is consistant on a bot.""" |
| 7 | 7 |
| 8 from recipe_engine import recipe_api | 8 from recipe_engine import recipe_api |
| 9 | 9 |
| 10 | 10 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 # Add log line output. | 225 # Add log line output. |
| 226 if 'log_lines' in step_result.json.output: | 226 if 'log_lines' in step_result.json.output: |
| 227 for log_name, log_lines in step_result.json.output['log_lines']: | 227 for log_name, log_lines in step_result.json.output['log_lines']: |
| 228 step_result.presentation.logs[log_name] = log_lines.splitlines() | 228 step_result.presentation.logs[log_name] = log_lines.splitlines() |
| 229 | 229 |
| 230 # Set the "checkout" path for the main solution. | 230 # Set the "checkout" path for the main solution. |
| 231 # This is used by the Chromium module to figure out where to look for | 231 # This is used by the Chromium module to figure out where to look for |
| 232 # the checkout. | 232 # the checkout. |
| 233 # If there is a patch failure, emit another step that said things failed. | 233 # If there is a patch failure, emit another step that said things failed. |
| 234 if step_result.json.output.get('patch_failure'): | 234 if step_result.json.output.get('patch_failure'): |
| 235 # TODO(phajdan.jr): Differentiate between failure to download the patch | 235 return_code = step_result.json.output.get('return_code') |
| 236 # and failure to apply it. The first is an infra failure, the latter | 236 if return_code == 89: |
| 237 # a definite patch failure. | 237 # This is download failure, hence an infra failure. |
| 238 self.m.tryserver.set_patch_failure_tryjob_result() | 238 # TODO(tandrii): self.m.tryserver.set_infra_failure() ? |
|
tandrii(chromium)
2015/10/02 11:34:39
what should I put here?
Sergiy Byelozyorov
2015/10/02 11:50:25
raise self.m.step.InfraFailure('Failed to download
tandrii(chromium)
2015/10/02 12:38:25
Done.
| |
| 239 else: | |
| 240 # This is actual patch failure. | |
| 241 self.m.tryserver.set_patch_failure_tryjob_result() | |
| 239 self.m.python.failing_step( | 242 self.m.python.failing_step( |
| 240 'Patch failure', 'Check the bot_update step for details') | 243 'Patch failure', 'Check the bot_update step for details') |
| 241 | 244 |
| 242 # bot_update actually just sets root to be the folder name of the | 245 # bot_update actually just sets root to be the folder name of the |
| 243 # first solution. | 246 # first solution. |
| 244 if step_result.json.output['did_run']: | 247 if step_result.json.output['did_run']: |
| 245 co_root = step_result.json.output['root'] | 248 co_root = step_result.json.output['root'] |
| 246 cwd = kwargs.get('cwd', self.m.path['slave_build']) | 249 cwd = kwargs.get('cwd', self.m.path['slave_build']) |
| 247 if 'checkout' not in self.m.path: | 250 if 'checkout' not in self.m.path: |
| 248 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) | 251 self.m.path['checkout'] = cwd.join(*co_root.split(self.m.path.sep)) |
| 249 | 252 |
| 250 return step_result | 253 return step_result |
| OLD | NEW |