Chromium Code Reviews| Index: scripts/slave/recipe_modules/swarming/api.py |
| diff --git a/scripts/slave/recipe_modules/swarming/api.py b/scripts/slave/recipe_modules/swarming/api.py |
| index de26cf14f11a01db085f0a8f4b7654c3a986b60e..1a1e86677bf12fa44b38f0d0e0befe345b4da906 100644 |
| --- a/scripts/slave/recipe_modules/swarming/api.py |
| +++ b/scripts/slave/recipe_modules/swarming/api.py |
| @@ -784,7 +784,8 @@ class SwarmingApi(recipe_api.RecipeApi): |
| # Check if it's an internal failure. |
| summary = self.m.json.loads( |
| step_result.raw_io.output_dir['summary.json']) |
| - if any(shard['internal_failure'] for shard in summary['shards']): |
| + if any(not shard or shard['internal_failure'] |
| + for shard in summary['shards']): |
| raise recipe_api.InfraFailure('Internal swarming failure.') |
| # Always show the shards' links in the collect step. (It looks |
| @@ -793,8 +794,12 @@ class SwarmingApi(recipe_api.RecipeApi): |
| links = step_result.presentation.links |
| for index in xrange(task.shards): |
| url = task.get_shard_view_url(index) |
| + if summary['shards'][index].get('exit_code', None) != 0: |
| + display_text = 'shard #%d (failed)' % index |
| + else: |
| + display_text = 'shard #%d' % index |
|
nednguyen
2016/09/22 21:47:07
Now I am missing test coverage at this line becaus
|
| if url: |
| - links['shard #%d' % index] = url |
| + links[display_text] = url |
| step_result.isolated_script_results = \ |
| self._merge_isolated_script_shards(task, step_result) |