Changeset 101299 in webkit
- Timestamp:
- Nov 28, 2011, 4:13:10 PM (15 years ago)
- Location:
- trunk/Tools
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
TestResultServer/model/jsonresults.py (modified) (6 diffs)
-
TestResultServer/model/jsonresults_unittest.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r101285 r101299 1 2011-11-28 Ojan Vafai <ojan@chromium.org> 2 3 Some of the results.json files have results/times entries at the directory level 4 https://bugs.webkit.org/show_bug.cgi?id=73261 5 6 Reviewed by Tony Chang. 7 8 This is just a bug that got introduced in a temporary push of the results server. 9 This patch repairs the broken files. After all the bots have cycled, we can simplify 10 this code to just assert that results/times are not at the directory level. 11 12 Also, when catching exceptions, log the full stacktrace. 13 14 * TestResultServer/model/jsonresults.py: 15 (_is_directory): 16 (JsonResults._load_json): 17 (JsonResults._merge_tests): 18 (JsonResults.merge): 19 * TestResultServer/model/jsonresults_unittest.py: 20 (JsonResultsTest.test_merge_directory_hierarchy_extra_results_and_times): 21 1 22 2011-11-28 Tony Chang <tony@chromium.org> 2 23 -
trunk/Tools/TestResultServer/model/jsonresults.py
r101280 r101299 30 30 from django.utils import simplejson 31 31 import logging 32 import sys 33 import traceback 32 34 33 35 from model.testfile import TestFile … … 80 82 81 83 84 def _is_directory(subtree): 85 # FIXME: Some data got corrupted and has results/times at the directory level. 86 # Once the data is fixed, this should assert that the directory level does not have 87 # results or times and just return "JSON_RESULTS_RESULTS not in subtree". 88 if JSON_RESULTS_RESULTS not in subtree: 89 return True 90 91 for key in subtree: 92 if key not in (JSON_RESULTS_RESULTS, JSON_RESULTS_TIMES): 93 del subtree[JSON_RESULTS_RESULTS] 94 del subtree[JSON_RESULTS_TIMES] 95 return True 96 97 return False 98 99 82 100 class JsonResults(object): 83 101 @classmethod … … 101 119 try: 102 120 return simplejson.loads(json_results_str) 103 except Exception, err:121 except: 104 122 logging.debug(json_results_str) 105 logging.error("Failed to load json results: %s", str(err))123 logging.error("Failed to load json results: %s", traceback.print_exception(*sys.exc_info())) 106 124 return None 107 125 … … 143 161 @classmethod 144 162 def _merge_tests(cls, aggregated_json, incremental_json, num_runs): 163 # FIXME: Some data got corrupted and has results/times at the directory level. 164 # Once the data is fixe, this should assert that the directory level does not have 165 # results or times and just return "JSON_RESULTS_RESULTS not in subtree". 166 if JSON_RESULTS_RESULTS in aggregated_json: 167 del aggregated_json[JSON_RESULTS_RESULTS] 168 if JSON_RESULTS_TIMES in aggregated_json: 169 del aggregated_json[JSON_RESULTS_TIMES] 170 145 171 all_tests = set(aggregated_json.iterkeys()) 146 172 if incremental_json: … … 153 179 154 180 incremental_sub_result = incremental_json[test_name] if incremental_json and test_name in incremental_json else None 155 if JSON_RESULTS_RESULTS not in aggregated_json[test_name]:181 if _is_directory(aggregated_json[test_name]): 156 182 cls._merge_tests(aggregated_json[test_name], incremental_sub_result, num_runs) 157 183 continue … … 276 302 try: 277 303 cls._merge_json(aggregated_json[builder], incremental_json[builder], num_runs) 278 except Exception, err:279 logging.error("Failed to merge json results: %s", str(err))304 except: 305 logging.error("Failed to merge json results: %s", traceback.print_exception(*sys.exc_info())) 280 306 return None 281 307 -
trunk/Tools/TestResultServer/model/jsonresults_unittest.py
r101280 r101299 575 575 "version": 4}) 576 576 577 # FIXME: Some data got corrupted and has results and times at the directory level. 578 # Once we've purged this from all the data, we should throw an error on this case. 579 def test_merge_directory_hierarchy_extra_results_and_times(self): 580 self._test_merge( 581 # Aggregated results 582 {"builds": ["2", "1"], 583 "tests": {"baz": { 584 "003.html": { 585 "results": [[25,"F"]], 586 "times": [[25,0]]}}, 587 "results": [[25,"F"]], 588 "times": [[25,0]]}}, 589 # Incremental results 590 {"builds": ["3"], 591 "tests": {"baz": { 592 "003.html": { 593 "results": [[1,"F"]], 594 "times": [[1,0]]}}}}, 595 # Expected results 596 {"builds": ["3", "2", "1"], 597 "tests": {"baz": { 598 "003.html": { 599 "results": [[26,"F"]], 600 "times": [[26,0]]}}}, 601 "version": 4}) 602 577 603 def test_merge_build_directory_hierarchy(self): 578 604 self._test_merge(
Note:
See TracChangeset
for help on using the changeset viewer.