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 import datetime | 5 import datetime |
6 import functools | 6 import functools |
7 | 7 |
8 from recipe_engine import recipe_api | 8 from recipe_engine import recipe_api |
9 | 9 |
10 | 10 |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
786 step_result.raw_io.output_dir['summary.json']) | 786 step_result.raw_io.output_dir['summary.json']) |
787 if any(shard['internal_failure'] for shard in summary['shards']): | 787 if any(shard['internal_failure'] for shard in summary['shards']): |
788 raise recipe_api.InfraFailure('Internal swarming failure.') | 788 raise recipe_api.InfraFailure('Internal swarming failure.') |
789 | 789 |
790 # Always show the shards' links in the collect step. (It looks | 790 # Always show the shards' links in the collect step. (It looks |
791 # like show_isolated_out_in_collect_step is false by default | 791 # like show_isolated_out_in_collect_step is false by default |
792 # in recipe runs.) | 792 # in recipe runs.) |
793 links = step_result.presentation.links | 793 links = step_result.presentation.links |
794 for index in xrange(task.shards): | 794 for index in xrange(task.shards): |
795 url = task.get_shard_view_url(index) | 795 url = task.get_shard_view_url(index) |
796 if summary['shards'][index] is None: | |
797 display_text = 'shard #%d (failed - result not received)' % index | |
M-A Ruel
2016/09/22 21:09:19
We should treat that as an infrastructure failure
nednguyen
2016/09/22 21:46:03
Done.
| |
798 elif summary['shards'][index].get('exit_code', 0) != 0: | |
M-A Ruel
2016/09/22 21:09:19
, None)
since if it's missing this is bad.
nednguyen
2016/09/22 21:46:03
Done.
| |
799 display_text = 'shard #%d (failed)' % index | |
800 else: | |
801 display_text = 'shard #%d' % index | |
796 if url: | 802 if url: |
797 links['shard #%d' % index] = url | 803 links[display_text] = url |
798 | 804 |
799 step_result.isolated_script_results = \ | 805 step_result.isolated_script_results = \ |
800 self._merge_isolated_script_shards(task, step_result) | 806 self._merge_isolated_script_shards(task, step_result) |
801 | 807 |
802 self._display_pending(summary, step_result.presentation) | 808 self._display_pending(summary, step_result.presentation) |
803 except Exception as e: | 809 except Exception as e: |
804 self.m.step.active_result.presentation.logs['no_results_exc'] = [str(e)] | 810 self.m.step.active_result.presentation.logs['no_results_exc'] = [str(e)] |
805 self.m.step.active_result.isolated_script_results = None | 811 self.m.step.active_result.isolated_script_results = None |
806 | 812 |
807 def _get_step_name(self, prefix, task): | 813 def _get_step_name(self, prefix, task): |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
989 | 995 |
990 def get_shard_view_url(self, index): | 996 def get_shard_view_url(self, index): |
991 """Returns URL of HTML page with shard details or None if not available. | 997 """Returns URL of HTML page with shard details or None if not available. |
992 | 998 |
993 Works only after the task has been successfully triggered. | 999 Works only after the task has been successfully triggered. |
994 """ | 1000 """ |
995 if self._trigger_output and self._trigger_output.get('tasks'): | 1001 if self._trigger_output and self._trigger_output.get('tasks'): |
996 for shard_dict in self._trigger_output['tasks'].itervalues(): | 1002 for shard_dict in self._trigger_output['tasks'].itervalues(): |
997 if shard_dict['shard_index'] == index: | 1003 if shard_dict['shard_index'] == index: |
998 return shard_dict['view_url'] | 1004 return shard_dict['view_url'] |
OLD | NEW |