Changeset 91704 in webkit
- Timestamp:
- Jul 25, 2011 1:45:12 PM (13 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r91701 r91704 1 2011-07-25 Ojan Vafai <ojan@chromium.org> 2 3 stop generating expectations.json now that it's unused 4 https://bugs.webkit.org/show_bug.cgi?id=65130 5 6 Reviewed by Adam Barth. 7 8 * Scripts/webkitpy/layout_tests/controllers/manager.py: 9 * Scripts/webkitpy/layout_tests/models/test_expectations.py: 10 * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py: 11 * TestResultServer/handlers/menu.py: 12 * TestResultServer/static-dashboards/dashboard_base.js: 13 * TestResultServer/static-dashboards/flakiness_dashboard.html: 14 1 15 2011-07-25 Ojan Vafai <ojan@chromium.org> 2 16 -
trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py
r91379 r91704 1041 1041 dir and upload the files to the appengine server. 1042 1042 1043 There are two different files written into the results dir:1044 expectations.json: This is used by the flakiness dashboard.1045 results.json: A full list of the results - used by the flakiness1046 dashboard and the aggregate results dashboard.1047 1048 1043 Args: 1049 1044 unexpected_results: dict of unexpected results … … 1061 1056 full_results_path = self._fs.join(self._results_directory, "full_results.json") 1062 1057 json_results_generator.write_json(self._fs, summarized_results, full_results_path) 1063 1064 # Write a json file of the test_expectations.txt file for the layout1065 # tests dashboard.1066 expectations_path = self._fs.join(self._results_directory, "expectations.json")1067 expectations_json = \1068 self._expectations.get_expectations_json_for_all_platforms()1069 self._fs.write_text_file(expectations_path,1070 u"ADD_EXPECTATIONS(%s);" % expectations_json)1071 1058 1072 1059 generator = json_layout_results_generator.JSONLayoutResultsGenerator( … … 1081 1068 _log.debug("Finished writing JSON files.") 1082 1069 1083 json_files = [" expectations.json", "incremental_results.json", "full_results.json", "times_ms.json"]1070 json_files = ["incremental_results.json", "full_results.json", "times_ms.json"] 1084 1071 1085 1072 generator.upload_json_files(json_files) … … 1089 1076 # Remove these files from the results directory so they don't take up too much space on the buildbot. 1090 1077 # The tools use the version we uploaded to the results server anyway. 1091 self._fs.remove(expectations_path)1092 1078 self._fs.remove(times_json_path) 1093 1079 self._fs.remove(incremental_results_path) -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r91311 r91704 122 122 123 123 124 class ModifiersAndExpectations:125 """A holder for modifiers and expectations on a test that serializes to126 JSON."""127 128 def __init__(self, modifiers, expectations):129 self.modifiers = modifiers130 self.expectations = expectations131 132 133 class ExpectationsJsonEncoder(json.JSONEncoder):134 """JSON encoder that can handle ModifiersAndExpectations objects."""135 def default(self, obj):136 # A ModifiersAndExpectations object has two fields, each of which137 # is a dict. Since JSONEncoders handle all the builtin types directly,138 # the only time this routine should be called is on the top level139 # object (i.e., the encoder shouldn't recurse).140 assert isinstance(obj, ModifiersAndExpectations)141 return {"modifiers": obj.modifiers,142 "expectations": obj.expectations}143 144 145 124 class TestExpectationSerializer: 146 125 """Provides means of serializing TestExpectationLine instances.""" … … 664 643 self._parser = TestExpectationParser(port, test_config, tests, is_lint_mode) 665 644 666 # Maps relative test paths as listed in the expectations file to a667 # list of maps containing modifiers and expectations for each time668 # the test is listed in the expectations file. We use this to669 # keep a representation of the entire list of expectations, even670 # invalid ones.671 self._all_expectations = {}672 673 645 self._expectations = TestExpectationParser.tokenize_list(expectations) 674 646 self._add_expectations(self._expectations, overrides_allowed=False) … … 777 749 self._model.add_expectation_line(TestExpectationLine.create_passing_expectation(test), overrides_allowed=False) 778 750 779 def get_expectations_json_for_all_platforms(self):780 # Specify separators in order to get compact encoding.781 return ExpectationsJsonEncoder(separators=(',', ':')).encode(782 self._all_expectations)783 784 751 def has_warnings(self): 785 752 return self._has_warnings … … 792 759 return TestExpectationSerializer.list_to_string(filter(without_rebaseline_modifier, self._expectations)) 793 760 794 def _add_to_all_expectations(self, test, modifiers, expectations):795 if not test in self._all_expectations:796 self._all_expectations[test] = []797 self._all_expectations[test].append(798 ModifiersAndExpectations(modifiers, expectations))799 800 761 def _add_expectations(self, expectation_list, overrides_allowed): 801 762 for expectation_line in expectation_list: 802 763 if not expectation_line.expectations: 803 764 continue 804 805 self._add_to_all_expectations(expectation_line.name,806 " ".join(expectation_line.modifiers).upper(),807 " ".join(expectation_line.expectations).upper())808 765 809 766 self._parser.parse(expectation_line) -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py
r91166 r91704 157 157 self.get_test('passes/text.html')), []) 158 158 159 def test_expectations_json_for_all_platforms(self):160 self.parse_exp(self.get_basic_expectations())161 json_str = self._exp.get_expectations_json_for_all_platforms()162 # FIXME: test actual content?163 self.assertTrue(json_str)164 165 159 def test_get_expectations_string(self): 166 160 self.parse_exp(self.get_basic_expectations()) -
trunk/Tools/TestResultServer/handlers/menu.py
r90674 r91704 41 41 ["List of test files", "/testfile"], 42 42 ["List of results.json files", "/testfile?name=results.json"], 43 ["List of expectations.json files", "/testfile?name=expectations.json"],44 43 ["Upload test file", "/testfile/uploadform"], 45 44 ] -
trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js
r91701 r91704 447 447 { 448 448 if (state.buildDir) { 449 // If buildDir is set, point to the results.json and expectations.json in the 450 // local tree. Useful for debugging changes to the python JSON generator. 449 // If buildDir is set, point to the results.json in the local tree. Useful for debugging changes to the python JSON generator. 451 450 g_defaultBuilderName = 'DUMMY_BUILDER_NAME'; 452 451 g_builders = {'DUMMY_BUILDER_NAME': ''}; -
trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html
r91624 r91704 290 290 <script src="dashboard_base.js"></script> 291 291 <script> 292 // @fileoverview Creates a dashboard for multiple runs of a given set of tests293 // on the buildbots. Pulls in JSONP-ish files with the results for running294 // tests on a given builder (i.e. ADD_RESULTS(json_here)) and the expectations295 // for all tests on all builders (i.e. ADD_EXPECTATIONS(json_here)).296 //297 // This shows flakiness of the tests as well as runtimes for slow tests.298 //299 // Also, each column in the dashboard is sortable.300 //301 // Currently, only webkit tests are supported, but adding other test types302 // should just require the following steps:303 // -generate results.json and expectations.json for these tests304 // -copy them to the appropriate location305 // -add the builder name to the list of builders below.306 307 292 ////////////////////////////////////////////////////////////////////////////// 308 293 // CONSTANTS
Note: See TracChangeset
for help on using the changeset viewer.