Changeset 91704 in webkit


Ignore:
Timestamp:
Jul 25, 2011 1:45:12 PM (13 years ago)
Author:
ojan@chromium.org
Message:

stop generating expectations.json now that it's unused
https://bugs.webkit.org/show_bug.cgi?id=65130

Reviewed by Adam Barth.

  • Scripts/webkitpy/layout_tests/controllers/manager.py:
  • Scripts/webkitpy/layout_tests/models/test_expectations.py:
  • Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
  • TestResultServer/handlers/menu.py:
  • TestResultServer/static-dashboards/dashboard_base.js:
  • TestResultServer/static-dashboards/flakiness_dashboard.html:
Location:
trunk/Tools
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r91701 r91704  
     12011-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
    1152011-07-25  Ojan Vafai  <ojan@chromium.org>
    216
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

    r91379 r91704  
    10411041        dir and upload the files to the appengine server.
    10421042
    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 flakiness
    1046             dashboard and the aggregate results dashboard.
    1047 
    10481043        Args:
    10491044          unexpected_results: dict of unexpected results
     
    10611056        full_results_path = self._fs.join(self._results_directory, "full_results.json")
    10621057        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 layout
    1065         # 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)
    10711058
    10721059        generator = json_layout_results_generator.JSONLayoutResultsGenerator(
     
    10811068        _log.debug("Finished writing JSON files.")
    10821069
    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"]
    10841071
    10851072        generator.upload_json_files(json_files)
     
    10891076        # Remove these files from the results directory so they don't take up too much space on the buildbot.
    10901077        # The tools use the version we uploaded to the results server anyway.
    1091         self._fs.remove(expectations_path)
    10921078        self._fs.remove(times_json_path)
    10931079        self._fs.remove(incremental_results_path)
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

    r91311 r91704  
    122122
    123123
    124 class ModifiersAndExpectations:
    125     """A holder for modifiers and expectations on a test that serializes to
    126     JSON."""
    127 
    128     def __init__(self, modifiers, expectations):
    129         self.modifiers = modifiers
    130         self.expectations = expectations
    131 
    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 which
    137         # is a dict. Since JSONEncoders handle all the builtin types directly,
    138         # the only time this routine should be called is on the top level
    139         # object (i.e., the encoder shouldn't recurse).
    140         assert isinstance(obj, ModifiersAndExpectations)
    141         return {"modifiers": obj.modifiers,
    142                 "expectations": obj.expectations}
    143 
    144 
    145124class TestExpectationSerializer:
    146125    """Provides means of serializing TestExpectationLine instances."""
     
    664643        self._parser = TestExpectationParser(port, test_config, tests, is_lint_mode)
    665644
    666         # Maps relative test paths as listed in the expectations file to a
    667         # list of maps containing modifiers and expectations for each time
    668         # the test is listed in the expectations file. We use this to
    669         # keep a representation of the entire list of expectations, even
    670         # invalid ones.
    671         self._all_expectations = {}
    672 
    673645        self._expectations = TestExpectationParser.tokenize_list(expectations)
    674646        self._add_expectations(self._expectations, overrides_allowed=False)
     
    777749                    self._model.add_expectation_line(TestExpectationLine.create_passing_expectation(test), overrides_allowed=False)
    778750
    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 
    784751    def has_warnings(self):
    785752        return self._has_warnings
     
    792759        return TestExpectationSerializer.list_to_string(filter(without_rebaseline_modifier, self._expectations))
    793760
    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 
    800761    def _add_expectations(self, expectation_list, overrides_allowed):
    801762        for expectation_line in expectation_list:
    802763            if not expectation_line.expectations:
    803764                continue
    804 
    805             self._add_to_all_expectations(expectation_line.name,
    806                                             " ".join(expectation_line.modifiers).upper(),
    807                                             " ".join(expectation_line.expectations).upper())
    808765
    809766            self._parser.parse(expectation_line)
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py

    r91166 r91704  
    157157                         self.get_test('passes/text.html')), [])
    158158
    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 
    165159    def test_get_expectations_string(self):
    166160        self.parse_exp(self.get_basic_expectations())
  • trunk/Tools/TestResultServer/handlers/menu.py

    r90674 r91704  
    4141    ["List of test files", "/testfile"],
    4242    ["List of results.json files", "/testfile?name=results.json"],
    43     ["List of expectations.json files", "/testfile?name=expectations.json"],
    4443    ["Upload test file", "/testfile/uploadform"],
    4544]
  • trunk/Tools/TestResultServer/static-dashboards/dashboard_base.js

    r91701 r91704  
    447447{
    448448    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.
    451450        g_defaultBuilderName = 'DUMMY_BUILDER_NAME';
    452451        g_builders = {'DUMMY_BUILDER_NAME': ''};
  • trunk/Tools/TestResultServer/static-dashboards/flakiness_dashboard.html

    r91624 r91704  
    290290<script src="dashboard_base.js"></script>
    291291<script>
    292 // @fileoverview Creates a dashboard for multiple runs of a given set of tests
    293 // on the buildbots. Pulls in JSONP-ish files with the results for running
    294 // tests on a given builder (i.e. ADD_RESULTS(json_here)) and the expectations
    295 // 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 types
    302 // should just require the following steps:
    303 //   -generate results.json and expectations.json for these tests
    304 //   -copy them to the appropriate location
    305 //   -add the builder name to the list of builders below.
    306 
    307292//////////////////////////////////////////////////////////////////////////////
    308293// CONSTANTS
Note: See TracChangeset for help on using the changeset viewer.