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 logging | 5 import logging |
6 import datetime | 6 import datetime |
7 import functools | 7 import functools |
8 | 8 |
9 from recipe_engine import recipe_api | 9 from recipe_engine import recipe_api |
10 | 10 |
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
840 step_result.raw_io.output_dir['summary.json']) | 840 step_result.raw_io.output_dir['summary.json']) |
841 if any(shard['internal_failure'] for shard in summary['shards']): | 841 if any(shard['internal_failure'] for shard in summary['shards']): |
842 raise recipe_api.InfraFailure('Internal swarming failure.') | 842 raise recipe_api.InfraFailure('Internal swarming failure.') |
843 | 843 |
844 # Always show the shards' links in the collect step. (It looks | 844 # Always show the shards' links in the collect step. (It looks |
845 # like show_isolated_out_in_collect_step is false by default | 845 # like show_isolated_out_in_collect_step is false by default |
846 # in recipe runs.) | 846 # in recipe runs.) |
847 links = step_result.presentation.links | 847 links = step_result.presentation.links |
848 for index in xrange(task.shards): | 848 for index in xrange(task.shards): |
849 url = task.get_shard_view_url(index) | 849 url = task.get_shard_view_url(index) |
850 if summary['shards'][index].get('exit_code', 0) != 0: | |
nednguyen
2016/09/22 15:54:40
I get to know this by looking at an example summar
M-A Ruel
2016/09/22 16:05:02
No. :/
Vadim Sh.
2016/09/22 17:36:30
Please also handle a case when summary['shards'][i
nednguyen
2016/09/22 21:03:54
Done. However I am missing the code coverage. You
| |
851 display_text = 'shard #%d (failed)' % index | |
852 else: | |
853 display_text = 'shard #%d' % index | |
850 if url: | 854 if url: |
851 links['shard #%d' % index] = url | 855 links[display_text] = url |
852 | 856 |
853 step_result.isolated_script_results = \ | 857 step_result.isolated_script_results = \ |
854 self._merge_isolated_script_shards(task, step_result) | 858 self._merge_isolated_script_shards(task, step_result) |
855 | 859 |
856 # Obtain chartjson results if present | 860 # Obtain chartjson results if present |
857 step_result.isolated_script_chartjson_results = \ | 861 step_result.isolated_script_chartjson_results = \ |
858 self._merge_isolated_script_chartjson_ouput_shards(task, step_result) | 862 self._merge_isolated_script_chartjson_ouput_shards(task, step_result) |
859 | 863 |
860 self._display_pending(summary, step_result.presentation) | 864 self._display_pending(summary, step_result.presentation) |
861 except Exception as e: | 865 except Exception as e: |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1047 | 1051 |
1048 def get_shard_view_url(self, index): | 1052 def get_shard_view_url(self, index): |
1049 """Returns URL of HTML page with shard details or None if not available. | 1053 """Returns URL of HTML page with shard details or None if not available. |
1050 | 1054 |
1051 Works only after the task has been successfully triggered. | 1055 Works only after the task has been successfully triggered. |
1052 """ | 1056 """ |
1053 if self._trigger_output and self._trigger_output.get('tasks'): | 1057 if self._trigger_output and self._trigger_output.get('tasks'): |
1054 for shard_dict in self._trigger_output['tasks'].itervalues(): | 1058 for shard_dict in self._trigger_output['tasks'].itervalues(): |
1055 if shard_dict['shard_index'] == index: | 1059 if shard_dict['shard_index'] == index: |
1056 return shard_dict['view_url'] | 1060 return shard_dict['view_url'] |
OLD | NEW |