Changeset 251961 in webkit
- Timestamp:
- Nov 1, 2019 6:17:10 PM (4 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r251959 r251961 1 2019-11-01 Jonathan Bedard <jbedard@apple.com> 2 3 Python 3: Add support in webkitpy.layout_tests.model 4 https://bugs.webkit.org/show_bug.cgi?id=203702 5 6 Reviewed by Stephanie Lewis. 7 8 * Scripts/test-webkitpy-python3: Add webkitpy.layout_tests.model. 9 * Scripts/webkitpy/layout_tests/models/test_configuration.py: 10 (SpecifierSorter.sort_specifiers): Convert iterator to list. 11 (TestConfigurationConverter.to_config_set): Use reduce from functors. 12 (TestConfigurationConverter.intersect_combination): Ditto. 13 * Scripts/webkitpy/layout_tests/models/test_expectations.py: 14 (TestExpectationsModel.get_test_set_for_keyword): Use iterators in both Python 2 15 and Python 3. 16 (TestExpectationsModel._remove_from_sets): Ditto. 17 (TestExpectations.parse_generic_expectations): Covert iterators to lists for indexing. 18 (TestExpectations.parse_default_port_expectations): Ditto. 19 (TestExpectations.parse_override_expectations): Ditto. 20 (TestExpectations.remove_configuration_from_test): Use any instead of just checking the 21 first element in the set. 22 * Scripts/webkitpy/layout_tests/models/test_run_results.py: 23 (summarize_results): Use items instead of iteritems. 24 1 25 2019-11-01 Devin Rousso <drousso@apple.com> 2 26 -
trunk/Tools/Scripts/test-webkitpy-python3
r251955 r251961 36 36 PYTHON3_COMPATIBLE_DIRECTORIES = [ 37 37 'webkitpy.common', 38 'webkitpy.layout_tests.models', 38 39 'webkitpy.port', 39 40 'webkitpy.results', -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_configuration.py
r225856 r251961 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import functools 29 30 import itertools 30 31 … … 98 99 99 100 def sort_specifiers(self, specifiers): 100 category_slots = map(lambda x: [], TestConfiguration.category_order())101 category_slots = list(map(lambda x: [], TestConfiguration.category_order())) 101 102 for specifier in specifiers: 102 103 category_slots[self.specifier_priority(specifier)].append(specifier) … … 106 107 return result + specifier_list 107 108 108 return reduce(sort_and_return, category_slots, [])109 return functools.reduce(sort_and_return, category_slots, []) 109 110 110 111 … … 163 164 matching_sets.setdefault(category, set()).update(configurations) 164 165 165 return reduce(set.intersection, matching_sets.values())166 return functools.reduce(set.intersection, matching_sets.values()) 166 167 167 168 @classmethod … … 197 198 @classmethod 198 199 def intersect_combination(cls, combination): 199 return reduce(set.intersection, [set(specifiers) for specifiers in combination])200 return functools.reduce(set.intersection, [set(specifiers) for specifiers in combination]) 200 201 201 202 @classmethod -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
r251112 r251961 33 33 import logging 34 34 import re 35 35 import sys 36 37 from webkitpy.common.iteration_compatibility import iteritems, itervalues 36 38 from webkitpy.layout_tests.models.test_configuration import TestConfigurationConverter 37 39 … … 567 569 # We must not have an index on this modifier. 568 570 matching_tests = set() 569 for test, modifiers in self._test_to_modifiers.iteritems():571 for test, modifiers in iteritems(self._test_to_modifiers): 570 572 if keyword.lower() in modifiers: 571 573 matching_tests.add(test) … … 695 697 test: test to look for 696 698 dict: dict of sets of files""" 697 for set_of_tests in dict_of_sets_of_tests.itervalues():699 for set_of_tests in itervalues(dict_of_sets_of_tests): 698 700 if test in set_of_tests: 699 701 set_of_tests.remove(test) … … 950 952 if self._port.path_to_generic_test_expectations_file() in self._expectations_dict: 951 953 if self._include_generic: 952 expectations = self._parser.parse( self._expectations_dict.keys()[self._expectations_dict_index], self._expectations_dict.values()[self._expectations_dict_index])954 expectations = self._parser.parse(list(self._expectations_dict.keys())[self._expectations_dict_index], list(self._expectations_dict.values())[self._expectations_dict_index]) 953 955 self._add_expectations(expectations) 954 956 self._expectations += expectations … … 957 959 def parse_default_port_expectations(self): 958 960 if len(self._expectations_dict) > self._expectations_dict_index: 959 expectations = self._parser.parse( self._expectations_dict.keys()[self._expectations_dict_index], self._expectations_dict.values()[self._expectations_dict_index])961 expectations = self._parser.parse(list(self._expectations_dict.keys())[self._expectations_dict_index], list(self._expectations_dict.values())[self._expectations_dict_index]) 960 962 self._add_expectations(expectations) 961 963 self._expectations += expectations … … 964 966 def parse_override_expectations(self): 965 967 while len(self._expectations_dict) > self._expectations_dict_index and self._include_overrides: 966 expectations = self._parser.parse( self._expectations_dict.keys()[self._expectations_dict_index], self._expectations_dict.values()[self._expectations_dict_index])968 expectations = self._parser.parse(list(self._expectations_dict.keys())[self._expectations_dict_index], list(self._expectations_dict.values())[self._expectations_dict_index]) 967 969 self._add_expectations(expectations) 968 970 self._expectations += expectations … … 1051 1053 if expectation.name != test or expectation.is_flaky() or not expectation.parsed_expectations: 1052 1054 continue 1053 if iter(expectation.parsed_expectations).next() not in (FAIL, IMAGE):1055 if not any([value in (FAIL, IMAGE) for value in expectation.parsed_expectations]): 1054 1056 continue 1055 1057 if test_configuration not in expectation.matching_configurations: -
trunk/Tools/Scripts/webkitpy/layout_tests/models/test_run_results.py
r240150 r251961 31 31 import logging 32 32 import signal 33 33 import sys 34 35 from webkitpy.common.iteration_compatibility import iteritems 34 36 from webkitpy.layout_tests.models import test_expectations 35 37 from webkitpy.layout_tests.models import test_failures … … 221 223 num_regressions = 0 222 224 keywords = {} 223 for expectation_string, expectation_enum in test_expectations.TestExpectations.EXPECTATIONS.ite ritems():225 for expectation_string, expectation_enum in test_expectations.TestExpectations.EXPECTATIONS.items(): 224 226 keywords[expectation_enum] = expectation_string.upper() 225 227 226 for modifier_string, modifier_enum in test_expectations.TestExpectations.MODIFIERS.ite ritems():228 for modifier_string, modifier_enum in test_expectations.TestExpectations.MODIFIERS.items(): 227 229 keywords[modifier_enum] = modifier_string.upper() 228 230 … … 230 232 other_crashes_dict = {} 231 233 232 for test_name, result in i nitial_results.results_by_name.iteritems():234 for test_name, result in iteritems(initial_results.results_by_name): 233 235 # Note that if a test crashed in the original run, we ignore 234 236 # whether or not it crashed when we retried it (if we retried it), … … 239 241 # This works because tests are run on the first device type which won't skip them, regardless of other expectations, and never re-run. 240 242 expected = 'SKIP' 241 expectations = expectations_by_type.values()[0]242 for element in expectations_by_type. itervalues():243 expectations = list(expectations_by_type.values())[0] 244 for element in expectations_by_type.values(): 243 245 test_expectation = element.filtered_expectations_for_test(test_name, pixel_tests_enabled, port_obj._options.world_leaks) 244 246 expected = element.model().expectations_to_string(test_expectation)
Note: See TracChangeset
for help on using the changeset viewer.