⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 160165 in webkit


Ignore:
Timestamp:
Dec 5, 2013, 2:32:13 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Remove certain methods from TestExpectations and use TestExpectationsModel instead of them
https://bugs.webkit.org/show_bug.cgi?id=125218

Patch by Dániel Bátyai <Batyai.Daniel@stud.u-szeged.hu> on 2013-12-05
Reviewed by Ryosuke Niwa.

  • Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:

(LayoutTestFinder.skip_tests):

  • Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:

(LayoutTestRunner.run_tests):
(LayoutTestRunner._update_summary_with_result):

  • Scripts/webkitpy/layout_tests/controllers/manager.py:

(Manager._test_is_slow):

  • Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:

(JSONLayoutResultsGenerator._insert_failure_summaries):

  • Scripts/webkitpy/layout_tests/models/test_expectations.py:

(TestExpectations.get_rebaselining_failures):

  • Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:

(assert_exp):
(MiscTests.test_multiple_results):
(MiscTests.test_category_expectations):
(MiscTests.test_get_modifiers):
(MiscTests.test_get_expectations_string):
(MiscTests.test_expectation_to_string):
(MiscTests.test_get_test_set):
(MiscTests.test_more_specific_override_resets_skip):
(SkippedTests.check):

  • Scripts/webkitpy/layout_tests/models/test_run_results.py:

(TestRunResults.init):
(summarize_results):

  • Scripts/webkitpy/tool/commands/rebaseline.py:

(RebaselineExpectations._tests_to_rebaseline):

Location:
trunk/Tools
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r160156 r160165  
     12013-12-05  Dániel Bátyai  <Batyai.Daniel@stud.u-szeged.hu>
     2
     3        Remove certain methods from TestExpectations and use TestExpectationsModel instead of them
     4        https://bugs.webkit.org/show_bug.cgi?id=125218
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py:
     9        (LayoutTestFinder.skip_tests):
     10        * Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
     11        (LayoutTestRunner.run_tests):
     12        (LayoutTestRunner._update_summary_with_result):
     13        * Scripts/webkitpy/layout_tests/controllers/manager.py:
     14        (Manager._test_is_slow):
     15        * Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
     16        (JSONLayoutResultsGenerator._insert_failure_summaries):
     17        * Scripts/webkitpy/layout_tests/models/test_expectations.py:
     18        (TestExpectations.get_rebaselining_failures):
     19        * Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py:
     20        (assert_exp):
     21        (MiscTests.test_multiple_results):
     22        (MiscTests.test_category_expectations):
     23        (MiscTests.test_get_modifiers):
     24        (MiscTests.test_get_expectations_string):
     25        (MiscTests.test_expectation_to_string):
     26        (MiscTests.test_get_test_set):
     27        (MiscTests.test_more_specific_override_resets_skip):
     28        (SkippedTests.check):
     29        * Scripts/webkitpy/layout_tests/models/test_run_results.py:
     30        (TestRunResults.__init__):
     31        (summarize_results):
     32        * Scripts/webkitpy/tool/commands/rebaseline.py:
     33        (RebaselineExpectations._tests_to_rebaseline):
     34
    1352013-12-04  Ryosuke Niwa  <rniwa@webkit.org>
    236
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_finder.py

    r135653 r160165  
    9797        all_tests = set(all_tests_list)
    9898
    99         tests_to_skip = expectations.get_tests_with_result_type(test_expectations.SKIP)
     99        tests_to_skip = expectations.model().get_tests_with_result_type(test_expectations.SKIP)
    100100        if self._options.skip_failing_tests:
    101             tests_to_skip.update(expectations.get_tests_with_result_type(test_expectations.FAIL))
    102             tests_to_skip.update(expectations.get_tests_with_result_type(test_expectations.FLAKY))
     101            tests_to_skip.update(expectations.model().get_tests_with_result_type(test_expectations.FAIL))
     102            tests_to_skip.update(expectations.model().get_tests_with_result_type(test_expectations.FLAKY))
    103103
    104104        if self._options.skipped == 'only':
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py

    r151201 r160165  
    9797
    9898        if not retrying:
    99             self._printer.print_expected(run_results, self._expectations.get_tests_with_result_type)
     99            self._printer.print_expected(run_results, self._expectations.model().get_tests_with_result_type)
    100100
    101101        for test_name in set(tests_to_skip):
     
    189189        else:
    190190            expected = self._expectations.matches_an_expected_result(result.test_name, result.type, self._options.pixel_tests or result.reftest_type)
    191             exp_str = self._expectations.get_expectations_string(result.test_name)
    192             got_str = self._expectations.expectation_to_string(result.type)
     191            exp_str = self._expectations.model().get_expectations_string(result.test_name)
     192            got_str = self._expectations.model().expectation_to_string(result.type)
    193193
    194194        run_results.add(result, expected, self._test_is_slow(result.test_name))
  • trunk/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

    r159453 r160165  
    138138
    139139    def _test_is_slow(self, test_file):
    140         return self._expectations.has_modifier(test_file, test_expectations.SLOW)
     140        return self._expectations.model().has_modifier(test_file, test_expectations.SLOW)
    141141
    142142    def needs_servers(self, test_names):
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py

    r148353 r160165  
    133133            self.FIXABLE)
    134134        self._insert_item_into_raw_list(results_for_builder,
    135             len(self._expectations.get_tests_with_timeline(
     135            len(self._expectations.model().get_tests_with_timeline(
    136136                test_expectations.NOW)), self.ALL_FIXABLE_COUNT)
    137137        self._insert_item_into_raw_list(results_for_builder,
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

    r158373 r160165  
    885885        return self._model.get_test_set(REBASELINE)
    886886
    887     # FIXME: Change the callsites to use TestExpectationsModel and remove.
    888     def get_expectations(self, test):
    889         return self._model.get_expectations(test)
    890 
    891     # FIXME: Change the callsites to use TestExpectationsModel and remove.
    892     def has_modifier(self, test, modifier):
    893         return self._model.has_modifier(test, modifier)
    894 
    895     # FIXME: Change the callsites to use TestExpectationsModel and remove.
    896     def get_tests_with_result_type(self, result_type):
    897         return self._model.get_tests_with_result_type(result_type)
    898 
    899     # FIXME: Change the callsites to use TestExpectationsModel and remove.
    900     def get_test_set(self, modifier, expectation=None, include_skips=True):
    901         return self._model.get_test_set(modifier, expectation, include_skips)
    902 
    903     # FIXME: Change the callsites to use TestExpectationsModel and remove.
    904     def get_modifiers(self, test):
    905         return self._model.get_modifiers(test)
    906 
    907     # FIXME: Change the callsites to use TestExpectationsModel and remove.
    908     def get_tests_with_timeline(self, timeline):
    909         return self._model.get_tests_with_timeline(timeline)
    910 
    911     def get_expectations_string(self, test):
    912         return self._model.get_expectations_string(test)
    913 
    914     def expectation_to_string(self, expectation):
    915         return self._model.expectation_to_string(expectation)
    916 
    917887    def matches_an_expected_result(self, test, result, pixel_tests_are_enabled):
    918888        expected_results = self._model.get_expectations(test)
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations_unittest.py

    r159998 r160165  
    8181
    8282    def assert_exp(self, test, result):
    83         self.assertEqual(self._exp.get_expectations(test),
     83        self.assertEqual(self._exp.model().get_expectations(test),
    8484                          set([result]))
    8585
     
    100100    def test_multiple_results(self):
    101101        self.parse_exp('Bug(x) failures/expected/text.html [ Crash Failure ]')
    102         self.assertEqual(self._exp.get_expectations(
     102        self.assertEqual(self._exp.model().get_expectations(
    103103            'failures/expected/text.html'),
    104104            set([FAIL, CRASH]))
     
    138138        test_name = 'failures/expected/unknown-test.html'
    139139        unknown_test = test_name
    140         self.assertRaises(KeyError, self._exp.get_expectations,
     140        self.assertRaises(KeyError, self._exp.model().get_expectations,
    141141                          unknown_test)
    142142        self.assert_exp('failures/expected/crash.html', PASS)
     
    144144    def test_get_modifiers(self):
    145145        self.parse_exp(self.get_basic_expectations())
    146         self.assertEqual(self._exp.get_modifiers('passes/text.html'), [])
     146        self.assertEqual(self._exp.model().get_modifiers('passes/text.html'), [])
    147147
    148148    def test_get_expectations_string(self):
    149149        self.parse_exp(self.get_basic_expectations())
    150         self.assertEqual(self._exp.get_expectations_string('failures/expected/text.html'), 'FAIL')
     150        self.assertEqual(self._exp.model().get_expectations_string('failures/expected/text.html'), 'FAIL')
    151151
    152152    def test_expectation_to_string(self):
    153153        # Normal cases are handled by other tests.
    154154        self.parse_exp(self.get_basic_expectations())
    155         self.assertRaises(ValueError, self._exp.expectation_to_string,
     155        self.assertRaises(ValueError, self._exp.model().expectation_to_string,
    156156                          -1)
    157157
     
    159159        # Handle some corner cases for this routine not covered by other tests.
    160160        self.parse_exp(self.get_basic_expectations())
    161         s = self._exp.get_test_set(WONTFIX)
     161        s = self._exp.model().get_test_set(WONTFIX)
    162162        self.assertEqual(s,
    163163            set(['failures/expected/crash.html',
     
    237237        self.assertFalse(self._port._filesystem.join(self._port.layout_tests_dir(),
    238238                                                     'failures/expected/text.html') in
    239                          self._exp.get_tests_with_result_type(SKIP))
     239                         self._exp.model().get_tests_with_result_type(SKIP))
    240240
    241241
     
    254254
    255255        # Check that the expectation is for BUG_DUMMY SKIP : ... [ Pass ]
    256         self.assertEqual(exp.get_modifiers('failures/expected/text.html'),
     256        self.assertEqual(exp.model().get_modifiers('failures/expected/text.html'),
    257257                          [TestExpectationParser.DUMMY_BUG_MODIFIER, TestExpectationParser.SKIP_MODIFIER, TestExpectationParser.WONTFIX_MODIFIER])
    258         self.assertEqual(exp.get_expectations('failures/expected/text.html'), set([PASS]))
     258        self.assertEqual(exp.model().get_expectations('failures/expected/text.html'), set([PASS]))
    259259
    260260    def test_skipped_tests_work(self):
  • trunk/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py

    r159847 r160165  
    5858            self.tests_by_expectation[expectation] = set()
    5959        for timeline in test_expectations.TestExpectations.TIMELINES.values():
    60             self.tests_by_timeline[timeline] = expectations.get_tests_with_timeline(timeline)
     60            self.tests_by_timeline[timeline] = expectations.model().get_tests_with_timeline(timeline)
    6161        self.slow_tests = set()
    6262        self.interrupted = False
     
    155155        # whether or not it crashed when we retried it (if we retried it),
    156156        # and always consider the result not flaky.
    157         expected = expectations.get_expectations_string(test_name)
     157        expected = expectations.model().get_expectations_string(test_name)
    158158        result_type = result.type
    159159        actual = [keywords[result_type]]
     
    169169            test_dict.update(reftest_type=list(result.reftest_type))
    170170
    171         if expectations.has_modifier(test_name, test_expectations.WONTFIX):
     171        if expectations.model().has_modifier(test_name, test_expectations.WONTFIX):
    172172            test_dict['wontfix'] = True
    173173
     
    185185        elif test_name in initial_results.unexpected_results_by_name:
    186186            if retry_results and test_name not in retry_results.unexpected_results_by_name:
    187                 actual.extend(expectations.get_expectations_string(test_name).split(" "))
     187                actual.extend(expectations.model().get_expectations_string(test_name).split(" "))
    188188                num_flaky += 1
    189189            elif retry_results:
     
    205205            test_dict['time'] = round(1000 * result.test_run_time)
    206206            # FIXME: Fix get_modifiers to return modifiers in new format.
    207             test_dict['modifiers'] = ' '.join(expectations.get_modifiers(test_name)).replace('BUGWK', 'webkit.org/b/')
     207            test_dict['modifiers'] = ' '.join(expectations.model().get_modifiers(test_name)).replace('BUGWK', 'webkit.org/b/')
    208208
    209209        test_dict.update(_interpret_test_failures(result.failures))
  • trunk/Tools/Scripts/webkitpy/tool/commands/rebaseline.py

    r159595 r160165  
    325325        expectations = TestExpectations(port, include_overrides=True)
    326326        for test in expectations.get_rebaselining_failures():
    327             tests_to_rebaseline[test] = TestExpectations.suffixes_for_expectations(expectations.get_expectations(test))
     327            tests_to_rebaseline[test] = TestExpectations.suffixes_for_expectations(expectations.model().get_expectations(test))
    328328        return tests_to_rebaseline
    329329
Note: See TracChangeset for help on using the changeset viewer.