Chromium Code Reviews| Index: scripts/slave/recipe_modules/test_utils/test_api.py |
| diff --git a/scripts/slave/recipe_modules/test_utils/test_api.py b/scripts/slave/recipe_modules/test_utils/test_api.py |
| index f373fefad758c0285f3558245d09139da9aaccea..f033caa4bcff921915463161f081484c7a3818f7 100644 |
| --- a/scripts/slave/recipe_modules/test_utils/test_api.py |
| +++ b/scripts/slave/recipe_modules/test_utils/test_api.py |
| @@ -115,7 +115,8 @@ class TestUtilsTestApi(recipe_test_api.RecipeTestApi): |
| def canned_isolated_script_output(self, passing, is_win, swarming=False, |
| shards=1, swarming_internal_failure=False, |
| isolated_script_passing=True, valid=True, |
| - missing_shards=[]): |
| + missing_shards=[], |
| + empty_shards=[]): |
| """Produces a test results' compatible json for isolated script tests. """ |
| per_shard_results = [] |
| for i in xrange(shards): |
| @@ -132,6 +133,7 @@ class TestUtilsTestApi(recipe_test_api.RecipeTestApi): |
| else: |
| jsonish_results['failures'] = tests_run |
| jsonish_results['successes'] = [] |
| + jsonish_results['times'] = { t : 0.1 for t in tests_run } |
|
Vadim Sh.
2016/07/15 19:16:31
nit: no spaces after { and before }: {t: 0.1 ....}
Ken Russell (switch to Gerrit)
2016/07/15 19:21:40
Done.
|
| per_shard_results.append(jsonish_results) |
| if swarming: |
| jsonish_shards = [] |
| @@ -144,7 +146,11 @@ class TestUtilsTestApi(recipe_test_api.RecipeTestApi): |
| if not i in missing_shards: |
| swarming_path = str(i) |
| swarming_path += '\\output.json' if is_win else '/output.json' |
| - files_dict[swarming_path] = json.dumps(per_shard_results[i]) |
| + if not i in empty_shards: |
|
Vadim Sh.
2016/07/15 19:16:31
nit: if i not in empty_shards
Ken Russell (switch to Gerrit)
2016/07/15 19:21:40
Done.
|
| + files_dict[swarming_path] = json.dumps(per_shard_results[i]) |
| + else: |
| + # Simulate a complete harness failure. |
| + files_dict[swarming_path] = '' |
| jsonish_summary = {'shards': jsonish_shards} |
| files_dict['summary.json'] = json.dumps(jsonish_summary) |
| return self.m.raw_io.output_dir(files_dict) |