Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: scripts/slave/recipe_modules/test_utils/test_api.py

Issue 2367623002: Revert of [swarming/api] Add text in to indicate whether a shard is failing (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 import json 1 import json
2 2
3 from recipe_engine import recipe_test_api 3 from recipe_engine import recipe_test_api
4 4
5 from .util import GTestResults, TestResults 5 from .util import GTestResults, TestResults
6 6
7 class TestUtilsTestApi(recipe_test_api.RecipeTestApi): 7 class TestUtilsTestApi(recipe_test_api.RecipeTestApi):
8 @recipe_test_api.placeholder_step_data 8 @recipe_test_api.placeholder_step_data
9 def test_results(self, test_results, retcode=None): 9 def test_results(self, test_results, retcode=None):
10 return self.m.json.output(test_results.as_jsonish(), retcode) 10 return self.m.json.output(test_results.as_jsonish(), retcode)
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 jsonish_results['failures'] = tests_run 134 jsonish_results['failures'] = tests_run
135 jsonish_results['successes'] = [] 135 jsonish_results['successes'] = []
136 jsonish_results['times'] = {t : 0.1 for t in tests_run} 136 jsonish_results['times'] = {t : 0.1 for t in tests_run}
137 per_shard_results.append(jsonish_results) 137 per_shard_results.append(jsonish_results)
138 if swarming: 138 if swarming:
139 jsonish_shards = [] 139 jsonish_shards = []
140 files_dict = {} 140 files_dict = {}
141 for i in xrange(shards): 141 for i in xrange(shards):
142 jsonish_shards.append({ 142 jsonish_shards.append({
143 'failure': not passing, 143 'failure': not passing,
144 'internal_failure': swarming_internal_failure, 144 'internal_failure': swarming_internal_failure
145 'exit_code': (1 if (not passing or swarming_internal_failure) else 0)
146 }) 145 })
147 if i not in missing_shards: 146 if i not in missing_shards:
148 swarming_path = str(i) 147 swarming_path = str(i)
149 swarming_path += '\\output.json' if is_win else '/output.json' 148 swarming_path += '\\output.json' if is_win else '/output.json'
150 if i not in empty_shards: 149 if i not in empty_shards:
151 files_dict[swarming_path] = json.dumps(per_shard_results[i]) 150 files_dict[swarming_path] = json.dumps(per_shard_results[i])
152 else: 151 else:
153 # Simulate a complete harness failure. 152 # Simulate a complete harness failure.
154 files_dict[swarming_path] = '' 153 files_dict[swarming_path] = ''
155 jsonish_summary = {'shards': jsonish_shards} 154 jsonish_summary = {'shards': jsonish_shards}
156 files_dict['summary.json'] = json.dumps(jsonish_summary) 155 files_dict['summary.json'] = json.dumps(jsonish_summary)
157 return self.m.raw_io.output_dir(files_dict) 156 return self.m.raw_io.output_dir(files_dict)
158 else: 157 else:
159 return self.m.json.output(per_shard_results[0]) 158 return self.m.json.output(per_shard_results[0])
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698