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

Side by Side Diff: scripts/slave/recipe_modules/test_results/resources/json_results_generator.py

Issue 1570713003: Flakiness dashboard: dump test results json instead of gtest json. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Fix base revision. Created 4 years, 11 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
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/test_results/resources/upload_gtest_test_results.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2015 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 """Generate JSON results from given test results. 5 """Generate JSON results from given test results.
6 6
7 Forked from build/scripts/slave/gtest/json_results_generator.py and original 7 Forked from build/scripts/slave/gtest/json_results_generator.py and original
8 will be deleted as all tests are moved to swarming. 8 will be deleted as all tests are moved to swarming.
9 """ 9 """
10 10
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 196
197 if modifier == TestResult.NONE: 197 if modifier == TestResult.NONE:
198 return (self.PASS_LABEL, actual) 198 return (self.PASS_LABEL, actual)
199 if modifier == TestResult.FLAKY: 199 if modifier == TestResult.FLAKY:
200 return (self.FLAKY_LABEL, actual) 200 return (self.FLAKY_LABEL, actual)
201 if modifier == TestResult.FAILS: 201 if modifier == TestResult.FAILS:
202 return (self.FAIL_LABEL, actual) 202 return (self.FAIL_LABEL, actual)
203 203
204 def _write_json(self, json_object, file_path): 204 def _write_json(self, json_object, file_path):
205 # Specify separators in order to get compact encoding. 205 # Specify separators in order to get compact encoding.
206 json_data = json.dumps(json_object, separators=(',', ':')) 206 json_data = json.dumps(json_object, separators=(',', ':'), indent=2)
207 json_string = json_data 207 json_string = json_data
208 if self._file_writer: 208 if self._file_writer:
209 self._file_writer(file_path, json_string) 209 self._file_writer(file_path, json_string)
210 else: 210 else:
211 with codecs.open(file_path, 'w', 'utf8') as f: 211 with codecs.open(file_path, 'w', 'utf8') as f:
212 f.write(json_string) 212 f.write(json_string)
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/test_results/resources/upload_gtest_test_results.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698