Changeset 229085 in webkit


Ignore:
Timestamp:
Feb 27, 2018 6:05:59 PM (6 years ago)
Author:
Jonathan Bedard
Message:

Remove concept of 'future'
https://bugs.webkit.org/show_bug.cgi?id=183184
<rdar://problem/37958594>

Reviewed by Aakash Jain.

Remove concept of 'future' from expectations and instead
use a system of inheritance centered around the current version
of an OS for Mac and iOS.

Inheritance works like so:

| ....
V Future

High Sierra (mac)

mac-sierra
| mac-elcapitan
| ....

This does not change expectation inheritance for any currently running
configurations, it generalizes the logic already used.

  • Scripts/webkitpy/common/version_name_map.py:

(VersionNameMap.init): Remove all future versions.
(VersionNameMap.mapping_for_platform): Return empty dicts instead of
asserting.

  • Scripts/webkitpy/port/apple.py:

(ApplePort):
(ApplePort._allowed_versions): Return all available versions.
(ApplePort._generate_all_test_configurations): Instead of picking from a set
of allowed versions, assume that every specified version is allowed.
(ApplePort._port_name_with_version): Deleted.

  • Scripts/webkitpy/port/darwin.py: Add CURRENT_VERSION overridden by subclasses.

(DarwinPort):

  • Scripts/webkitpy/port/ios.py:

(IOSPort):
(IOSPort.default_baseline_search_path): Use system of inheritance centered around
the current version.

  • Scripts/webkitpy/port/mac.py:

(MacPort):
(MacPort.init): Use current version by default.
(MacPort.default_baseline_search_path): Use system of inheritance centered around
the current version.
(MacPort.configuration_specifier_macros): Use the same set of version names
supported in default_baseline_search_path.

  • Scripts/webkitpy/port/mac_unittest.py:

(MacTest.test_versions): Remove 'future' tests.

Location:
trunk/Tools
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r229082 r229085  
     12018-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
    1512018-02-27  Michael Catanzaro  <mcatanzaro@igalia.com>
    252
  • trunk/Tools/Scripts/webkitpy/common/version_name_map.py

    r226263 r229085  
    2828
    2929PUBLIC_TABLE = 'public'
     30INTERNAL_TABLE = 'internal'
    3031
    3132
     
    5960                'Sierra': Version(10, 12),
    6061                'High Sierra': Version(10, 13),
    61                 'Future': Version(10, 14),
    6262            },
    63             'ios': self._automap_to_major_version('iOS', minimum=Version(10), maximum=Version(12)),
    64             'tvos': self._automap_to_major_version('tvOS', minimum=Version(10), maximum=Version(12)),
    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)),
    6666            'win': {
    6767                'Win10': Version(10),
     
    144144        """return proper os_name: os_version mapping for platform"""
    145145        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  
    3434from webkitpy.port.config import apple_additions
    3535from webkitpy.layout_tests.models.test_configuration import TestConfiguration
     36from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE
    3637
    3738
     
    4344
    4445    # overridden in subclasses
    45     VERSION_MIN = None
    46     VERSION_MAX = None
    4746    ARCHITECTURES = []
    4847    _crash_logs_to_skip_for_host = {}
     
    9594        return True
    9695
    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 
    10296    @memoized
    10397    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)
    108102
    109103    def _generate_all_test_configurations(self):
     
    112106            for build_type in self.ALL_BUILD_TYPES:
    113107                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))
    116112        return configurations
    117113
  • trunk/Tools/Scripts/webkitpy/port/darwin.py

    r220708 r229085  
    3737class DarwinPort(ApplePort):
    3838
     39    CURRENT_VERSION = None
    3940    SDK = None
    4041
  • trunk/Tools/Scripts/webkitpy/port/ios.py

    r226715 r229085  
    2626from webkitpy.common.memoized import memoized
    2727from webkitpy.common.version import Version
    28 from webkitpy.common.version_name_map import VersionNameMap
     28from webkitpy.common.version_name_map import VersionNameMap, INTERNAL_TABLE
    2929from webkitpy.layout_tests.models.test_configuration import TestConfiguration
    3030from webkitpy.port.config import apple_additions
     
    3838    port_name = "ios"
    3939
    40     VERSION_MIN = Version(11)
    41     VERSION_MAX = Version(12)
     40    CURRENT_VERSION = Version(11)
    4241
    4342    def __init__(self, host, port_name, **kwargs):
     
    9695        if self.get_option('webkit_test_runner'):
    9796            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
    100110        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:
    104112            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
    106116            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)))
    109119            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)))
    112122
    113123        if apple_additions():
     
    118128        expectations.append(self._webkit_baseline_path(self.port_name))
    119129
    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)
    121134            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)))
    124137
    125138        if apple_additions():
  • trunk/Tools/Scripts/webkitpy/port/mac.py

    r226786 r229085  
    3535from webkitpy.common.system.executive import ScriptError
    3636from webkitpy.common.version import Version
     37from webkitpy.common.version_name_map import PUBLIC_TABLE, INTERNAL_TABLE
    3738from webkitpy.common.version_name_map import VersionNameMap
    3839from webkitpy.port.config import apple_additions
     
    4546    port_name = "mac"
    4647
    47     VERSION_MIN = Version(10, 6)
    48     VERSION_MAX = Version(10, 14)
     48    CURRENT_VERSION = Version(10, 13)
    4949
    5050    SDK = 'macosx'
     
    6262            self._os_version = self.host.platform.os_version
    6363        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
    6667
    6768    def _build_driver_flags(self):
     
    7071    @memoized
    7172    def default_baseline_search_path(self):
     73        versions_to_fallback = []
    7274        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]
    7578        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
    7886        wk_string = 'wk1'
    7987        if self.get_option('webkit_test_runner'):
     
    8189
    8290        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
    8596            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
    8999            if apple_name:
    90100                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)))
    92103            if apple_name:
    93104                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)))
    95107
    96108        if apple_additions():
     
    107119    @memoized
    108120    def configuration_specifier_macros(self):
    109         map = {}
     121        config_map = {}
    110122        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
    118136
    119137    def setup_environ_for_server(self, server_name=None):
  • trunk/Tools/Scripts/webkitpy/port/mac_unittest.py

    r225856 r229085  
    6969        self.assert_name('mac-highsierra', 'elcapitan', 'mac-highsierra')
    7070        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')
    7371        self.assertRaises(AssertionError, self.assert_name, 'mac-tiger', 'leopard', 'mac-leopard')
    7472
  • trunk/Tools/Scripts/webkitpy/port/port_testcase.py

    r225856 r229085  
    4444from webkitpy.common.system.outputcapture import OutputCapture
    4545from webkitpy.common.system.systemhost_mock import MockSystemHost
     46from webkitpy.common.version_name_map import INTERNAL_TABLE
    4647from webkitpy.port.base import Port
    4748from webkitpy.port.config import apple_additions
     
    9899        def version_name_mapping(platform=None):
    99100            result = VersionNameMap(platform)
    100             result.mapping['internal'] = {}
     101            result.mapping[INTERNAL_TABLE] = {}
    101102            for platform in result.mapping[PUBLIC_TABLE]:
    102                 result.mapping['internal'][platform] = {}
     103                result.mapping[INTERNAL_TABLE][platform] = {}
    103104                for name, version in result.mapping[PUBLIC_TABLE][platform].iteritems():
    104                     result.mapping['internal'][platform]['add-' + name] = version
     105                    result.mapping[INTERNAL_TABLE][platform]['add-' + name] = version
    105106            return result
    106107
Note: See TracChangeset for help on using the changeset viewer.