Changeset 229085 in webkit
- Timestamp:
- Feb 27, 2018 6:05:59 PM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r229082 r229085 1 2018-02-27 Jonathan Bedard <jbedard@apple.com> 2 3 Remove concept of 'future' 4 https://bugs.webkit.org/show_bug.cgi?id=183184 5 <rdar://problem/37958594> 6 7 Reviewed by Aakash Jain. 8 9 Remove concept of 'future' from expectations and instead 10 use a system of inheritance centered around the current version 11 of an OS for Mac and iOS. 12 13 Inheritance works like so: 14 15 | .... 16 V Future 17 > High Sierra (mac) 18 ^ mac-sierra 19 | mac-elcapitan 20 | .... 21 22 This does not change expectation inheritance for any currently running 23 configurations, it generalizes the logic already used. 24 25 * Scripts/webkitpy/common/version_name_map.py: 26 (VersionNameMap.__init__): Remove all future versions. 27 (VersionNameMap.mapping_for_platform): Return empty dicts instead of 28 asserting. 29 * Scripts/webkitpy/port/apple.py: 30 (ApplePort): 31 (ApplePort._allowed_versions): Return all available versions. 32 (ApplePort._generate_all_test_configurations): Instead of picking from a set 33 of allowed versions, assume that every specified version is allowed. 34 (ApplePort._port_name_with_version): Deleted. 35 * Scripts/webkitpy/port/darwin.py: Add CURRENT_VERSION overridden by subclasses. 36 (DarwinPort): 37 * Scripts/webkitpy/port/ios.py: 38 (IOSPort): 39 (IOSPort.default_baseline_search_path): Use system of inheritance centered around 40 the current version. 41 * Scripts/webkitpy/port/mac.py: 42 (MacPort): 43 (MacPort.__init__): Use current version by default. 44 (MacPort.default_baseline_search_path): Use system of inheritance centered around 45 the current version. 46 (MacPort.configuration_specifier_macros): Use the same set of version names 47 supported in default_baseline_search_path. 48 * Scripts/webkitpy/port/mac_unittest.py: 49 (MacTest.test_versions): Remove 'future' tests. 50 1 51 2018-02-27 Michael Catanzaro <mcatanzaro@igalia.com> 2 52 -
trunk/Tools/Scripts/webkitpy/common/version_name_map.py
r226263 r229085 28 28 29 29 PUBLIC_TABLE = 'public' 30 INTERNAL_TABLE = 'internal' 30 31 31 32 … … 59 60 'Sierra': Version(10, 12), 60 61 'High Sierra': Version(10, 13), 61 'Future': Version(10, 14),62 62 }, 63 'ios': self._automap_to_major_version('iOS', minimum=Version(10), maximum=Version(1 2)),64 'tvos': self._automap_to_major_version('tvOS', minimum=Version(10), maximum=Version(1 2)),65 'watchos': self._automap_to_major_version('watchOS', minimum=Version(1), maximum=Version( 5)),63 'ios': self._automap_to_major_version('iOS', minimum=Version(10), maximum=Version(11)), 64 'tvos': self._automap_to_major_version('tvOS', minimum=Version(10), maximum=Version(11)), 65 'watchos': self._automap_to_major_version('watchOS', minimum=Version(1), maximum=Version(4)), 66 66 'win': { 67 67 'Win10': Version(10), … … 144 144 """return proper os_name: os_version mapping for platform""" 145 145 platform = self.default_system_platform if platform is None else platform 146 assert table in self.mapping 147 assert platform in self.mapping[table] 148 return self.mapping[table][platform] 146 return self.mapping.get(table, {}).get(platform, {}) -
trunk/Tools/Scripts/webkitpy/port/apple.py
r225856 r229085 34 34 from webkitpy.port.config import apple_additions 35 35 from webkitpy.layout_tests.models.test_configuration import TestConfiguration 36 from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE 36 37 37 38 … … 43 44 44 45 # overridden in subclasses 45 VERSION_MIN = None46 VERSION_MAX = None47 46 ARCHITECTURES = [] 48 47 _crash_logs_to_skip_for_host = {} … … 95 94 return True 96 95 97 # FIXME: A more sophisticated version of this function should move to WebKitPort and replace all calls to name().98 # This is also a misleading name, since 'mac-future' gets remapped to 'mac'.99 def _port_name_with_version(self):100 return self.name().replace('-future', '').replace('-wk2', '')101 102 96 @memoized 103 97 def _allowed_versions(self): 104 if self.VERSION_MIN is None or self.VERSION_MAX is None:105 return []106 sorted_versions = sorted(VersionNameMap.map(self.host.platform).mapping_for_platform(platform=self.port_name.split('-')[0]).values())107 return sorted _versions[sorted_versions.index(self.VERSION_MIN):sorted_versions.index(self.VERSION_MAX) + 1]98 versions = set() 99 for table in [PUBLIC_TABLE, INTERNAL_TABLE]: 100 versions.update(VersionNameMap.map(self.host.platform).mapping_for_platform(platform=self.port_name.split('-')[0], table=table).values()) 101 return sorted(versions) 108 102 109 103 def _generate_all_test_configurations(self): … … 112 106 for build_type in self.ALL_BUILD_TYPES: 113 107 for architecture in self.ARCHITECTURES: 114 version_name = VersionNameMap.map(self.host.platform).to_name(version, platform=self.port_name.split('-')[0]) 115 configurations.append(TestConfiguration(version=version_name, architecture=architecture, build_type=build_type)) 108 for table in [PUBLIC_TABLE, INTERNAL_TABLE]: 109 version_name = VersionNameMap.map(self.host.platform).to_name(version, platform=self.port_name.split('-')[0], table=table) 110 if version_name: 111 configurations.append(TestConfiguration(version=version_name, architecture=architecture, build_type=build_type)) 116 112 return configurations 117 113 -
trunk/Tools/Scripts/webkitpy/port/darwin.py
r220708 r229085 37 37 class DarwinPort(ApplePort): 38 38 39 CURRENT_VERSION = None 39 40 SDK = None 40 41 -
trunk/Tools/Scripts/webkitpy/port/ios.py
r226715 r229085 26 26 from webkitpy.common.memoized import memoized 27 27 from webkitpy.common.version import Version 28 from webkitpy.common.version_name_map import VersionNameMap 28 from webkitpy.common.version_name_map import VersionNameMap, INTERNAL_TABLE 29 29 from webkitpy.layout_tests.models.test_configuration import TestConfiguration 30 30 from webkitpy.port.config import apple_additions … … 38 38 port_name = "ios" 39 39 40 VERSION_MIN = Version(11) 41 VERSION_MAX = Version(12) 40 CURRENT_VERSION = Version(11) 42 41 43 42 def __init__(self, host, port_name, **kwargs): … … 96 95 if self.get_option('webkit_test_runner'): 97 96 wk_string = 'wk2' 98 # If we don't have a specified version, that means we using the port without an SDK. 99 # This usually means we're doing some type of testing.In this case, don't add version fallbacks 97 98 versions_to_fallback = [] 99 if self.ios_version() == self.CURRENT_VERSION: 100 versions_to_fallback = [self.CURRENT_VERSION] 101 elif self.ios_version(): 102 temp_version = Version(self.ios_version().major) 103 while temp_version != self.CURRENT_VERSION: 104 versions_to_fallback.append(Version.from_iterable(temp_version)) 105 if temp_version < self.CURRENT_VERSION: 106 temp_version.major += 1 107 else: 108 temp_version.major -= 1 109 100 110 expectations = [] 101 if apple_additions() and self.ios_version(): 102 apple_name = VersionNameMap.map(self.host.platform).to_name(self.ios_version(), platform=IOSPort.port_name, table='internal').lower().replace(' ', '') 103 else: 111 for version in versions_to_fallback: 104 112 apple_name = None 105 if self.ios_version(): 113 if apple_additions(): 114 apple_name = VersionNameMap.map(self.host.platform).to_name(version, platform=IOSPort.port_name, table=INTERNAL_TABLE) 115 106 116 if apple_name: 107 expectations.append(self._apple_baseline_path('{}-{}-{}'.format(self.port_name, apple_name , wk_string)))108 expectations.append(self._webkit_baseline_path('{}-{}-{}'.format(self.port_name, self.ios_version().major, wk_string)))117 expectations.append(self._apple_baseline_path('{}-{}-{}'.format(self.port_name, apple_name.lower().replace(' ', ''), wk_string))) 118 expectations.append(self._webkit_baseline_path('{}-{}-{}'.format(self.port_name, version.major, wk_string))) 109 119 if apple_name: 110 expectations.append(self._apple_baseline_path('{}-{}'.format(self.port_name, apple_name )))111 expectations.append(self._webkit_baseline_path('{}-{}'.format(self.port_name, self.ios_version().major)))120 expectations.append(self._apple_baseline_path('{}-{}'.format(self.port_name, apple_name.lower().replace(' ', '')))) 121 expectations.append(self._webkit_baseline_path('{}-{}'.format(self.port_name, version.major))) 112 122 113 123 if apple_additions(): … … 118 128 expectations.append(self._webkit_baseline_path(self.port_name)) 119 129 120 if self.ios_version(): 130 for version in versions_to_fallback: 131 apple_name = None 132 if apple_additions(): 133 apple_name = VersionNameMap.map(self.host.platform).to_name(version, platform=IOSPort.port_name, table=INTERNAL_TABLE) 121 134 if apple_name: 122 expectations.append(self._apple_baseline_path('{}-{}'.format(IOSPort.port_name, apple_name )))123 expectations.append(self._webkit_baseline_path('{}-{}'.format(IOSPort.port_name, self.ios_version().major)))135 expectations.append(self._apple_baseline_path('{}-{}'.format(IOSPort.port_name, apple_name.lower().replace(' ', '')))) 136 expectations.append(self._webkit_baseline_path('{}-{}'.format(IOSPort.port_name, version.major))) 124 137 125 138 if apple_additions(): -
trunk/Tools/Scripts/webkitpy/port/mac.py
r226786 r229085 35 35 from webkitpy.common.system.executive import ScriptError 36 36 from webkitpy.common.version import Version 37 from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE 37 38 from webkitpy.common.version_name_map import VersionNameMap 38 39 from webkitpy.port.config import apple_additions … … 45 46 port_name = "mac" 46 47 47 VERSION_MIN = Version(10, 6) 48 VERSION_MAX = Version(10, 14) 48 CURRENT_VERSION = Version(10, 13) 49 49 50 50 SDK = 'macosx' … … 62 62 self._os_version = self.host.platform.os_version 63 63 else: 64 sorted_versions = sorted(version_name_map.mapping_for_platform(platform=self.port_name).values()) 65 self._os_version = sorted_versions[sorted_versions.index(self.VERSION_MAX) - 1] 64 self._os_version = MacPort.CURRENT_VERSION 65 assert self._os_version 66 assert self._os_version.major == 10 66 67 67 68 def _build_driver_flags(self): … … 70 71 @memoized 71 72 def default_baseline_search_path(self): 73 versions_to_fallback = [] 72 74 version_name_map = VersionNameMap.map(self.host.platform) 73 if self._os_version < self.VERSION_MIN or self._os_version >= self.VERSION_MAX: 74 version_fallback = [self._os_version] 75 76 if self._os_version == self.CURRENT_VERSION: 77 versions_to_fallback = [self.CURRENT_VERSION] 75 78 else: 76 sorted_versions = sorted(version_name_map.mapping_for_platform(platform=self.port_name).values()) 77 version_fallback = sorted_versions[sorted_versions.index(self._os_version):-1] 79 temp_version = Version(self._os_version.major, self._os_version.minor) 80 while temp_version != self.CURRENT_VERSION: 81 versions_to_fallback.append(Version.from_iterable(temp_version)) 82 if temp_version < self.CURRENT_VERSION: 83 temp_version.minor += 1 84 else: 85 temp_version.minor -= 1 78 86 wk_string = 'wk1' 79 87 if self.get_option('webkit_test_runner'): … … 81 89 82 90 expectations = [] 83 for version in version_fallback: 84 version_name = version_name_map.to_name(version, platform=self.port_name).lower().replace(' ', '') 91 for version in versions_to_fallback: 92 version_name = version_name_map.to_name(version, platform=self.port_name) 93 if version_name: 94 standardized_version_name = version_name.lower().replace(' ', '') 95 apple_name = None 85 96 if apple_additions(): 86 apple_name = version_name_map.to_name(version, platform=self.port_name, table='internal') 87 else: 88 apple_name = None 97 apple_name = version_name_map.to_name(version, platform=self.port_name, table=INTERNAL_TABLE) 98 89 99 if apple_name: 90 100 expectations.append(self._apple_baseline_path('mac-{}-{}'.format(apple_name.lower().replace(' ', ''), wk_string))) 91 expectations.append(self._webkit_baseline_path('mac-{}-{}'.format(version_name, wk_string))) 101 if version_name: 102 expectations.append(self._webkit_baseline_path('mac-{}-{}'.format(standardized_version_name, wk_string))) 92 103 if apple_name: 93 104 expectations.append(self._apple_baseline_path('mac-{}'.format(apple_name.lower().replace(' ', '')))) 94 expectations.append(self._webkit_baseline_path('mac-{}'.format(version_name))) 105 if version_name: 106 expectations.append(self._webkit_baseline_path('mac-{}'.format(standardized_version_name))) 95 107 96 108 if apple_additions(): … … 107 119 @memoized 108 120 def configuration_specifier_macros(self): 109 map = {}121 config_map = {} 110 122 version_name_map = VersionNameMap.map(self.host.platform) 111 sorted_versions = sorted(version_name_map.mapping_for_platform(platform=self.port_name).values()) 112 for version in sorted_versions: 113 list = [] 114 for newer in sorted_versions[sorted_versions.index(version):]: 115 list.append(version_name_map.to_name(newer, platform=self.port_name).lower().replace(' ', '')) 116 map[version_name_map.to_name(version, platform=self.port_name).lower().replace(' ', '') + '+'] = list 117 return map 123 for version in self._allowed_versions(): 124 version_names = [] 125 for newer in self._allowed_versions()[self._allowed_versions().index(version):]: 126 version_name = version_name_map.to_name(newer, platform=self.port_name) 127 if not version_name: 128 version_name = version_name_map.to_name(newer, platform=self.port_name, table=INTERNAL_TABLE) 129 version_names.append(version_name.lower().replace(' ', '')) 130 for table in [PUBLIC_TABLE, INTERNAL_TABLE]: 131 version_name = version_name_map.to_name(version, platform=self.port_name, table=table) 132 if not version_name: 133 continue 134 config_map[version_name.lower().replace(' ', '') + '+'] = version_names 135 return config_map 118 136 119 137 def setup_environ_for_server(self, server_name=None): -
trunk/Tools/Scripts/webkitpy/port/mac_unittest.py
r225856 r229085 69 69 self.assert_name('mac-highsierra', 'elcapitan', 'mac-highsierra') 70 70 self.assert_name('mac-highsierra', 'sierra', 'mac-highsierra') 71 self.assert_name('mac', 'future', 'mac-future')72 self.assert_name('mac-future', 'future', 'mac-future')73 71 self.assertRaises(AssertionError, self.assert_name, 'mac-tiger', 'leopard', 'mac-leopard') 74 72 -
trunk/Tools/Scripts/webkitpy/port/port_testcase.py
r225856 r229085 44 44 from webkitpy.common.system.outputcapture import OutputCapture 45 45 from webkitpy.common.system.systemhost_mock import MockSystemHost 46 from webkitpy.common.version_name_map import INTERNAL_TABLE 46 47 from webkitpy.port.base import Port 47 48 from webkitpy.port.config import apple_additions … … 98 99 def version_name_mapping(platform=None): 99 100 result = VersionNameMap(platform) 100 result.mapping[ 'internal'] = {}101 result.mapping[INTERNAL_TABLE] = {} 101 102 for platform in result.mapping[PUBLIC_TABLE]: 102 result.mapping[ 'internal'][platform] = {}103 result.mapping[INTERNAL_TABLE][platform] = {} 103 104 for name, version in result.mapping[PUBLIC_TABLE][platform].iteritems(): 104 result.mapping[ 'internal'][platform]['add-' + name] = version105 result.mapping[INTERNAL_TABLE][platform]['add-' + name] = version 105 106 return result 106 107
Note: See TracChangeset
for help on using the changeset viewer.