Changeset 221079 in webkit
- Timestamp:
- Aug 23, 2017 10:04:25 AM (7 years ago)
- Location:
- trunk/Tools
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r221069 r221079 1 2017-08-23 Jonathan Bedard <jbedard@apple.com> 2 3 Access expectations path through apple_additions 4 https://bugs.webkit.org/show_bug.cgi?id=174800 5 <rdar://problem/33498899> 6 7 Reviewed by Alexey Proskuryakov. 8 9 When external test expectations are imported through additional-platform-directory, they will 10 over-write any WebKit expectations. Access some expectations from apple_additions to correct 11 these precedence issues. 12 13 * Scripts/webkitpy/port/ios.py: 14 (IOSPort._apple_additions_path): Convert test expectation directory to a path 15 coming from apple_additions. 16 (IOSPort.default_baseline_search_path): Alternate between WebKit path and apple_additions 17 path for layout test expectations. 18 * Scripts/webkitpy/port/ios_device_unittest.py: 19 (IOSDeviceTest.test_layout_test_searchpath_with_apple_additions): Added to test layout-test search paths. 20 * Scripts/webkitpy/port/ios_simulator_unittest.py: 21 (IOSSimulatorTest.test_layout_test_searchpath_with_apple_additions): Added to test layout-test search paths. 22 * Scripts/webkitpy/port/mac.py: 23 (MacPort._apple_additions_path): Convert test expectation directory to a path 24 coming from apple_additions. 25 (MacPort.default_baseline_search_path): Alternate between WebKit path and apple_additions 26 path for layout test expectations. 27 * Scripts/webkitpy/port/mac_unittest.py: 28 (MacTest.test_layout_test_searchpath_with_apple_additions): Added to test layout-test search paths. 29 * Scripts/webkitpy/port/port_testcase.py: 30 (bind_mock_apple_additions): Added to create mock apple_additions for a block. 31 (bind_mock_apple_additions.MockAppleAdditions): Contains apple_addition stubs for testing. 32 * Scripts/webkitpy/port/win.py: 33 (WinPort.default_baseline_search_path): Include apple_additions test expectation for Windows. 34 1 35 2017-08-22 Zan Dobersek <zdobersek@igalia.com> 2 36 -
trunk/Tools/Scripts/webkitpy/port/ios.py
r219875 r221079 26 26 from webkitpy.common.memoized import memoized 27 27 from webkitpy.layout_tests.models.test_configuration import TestConfiguration 28 from webkitpy.port.config import apple_additions 28 29 from webkitpy.port.darwin import DarwinPort 29 30 from webkitpy.port.simulator_process import SimulatorProcess … … 87 88 return self._current_device 88 89 90 def _apple_additions_path(self, name): 91 if name == 'wk2': 92 return None 93 split_name = name.split('-') 94 if len(split_name) > 1 and split_name[1] != 'wk1' and split_name[1] != 'wk2' and split_name[1] != 'simulator' and split_name[1] != 'device': 95 os_name = apple_additions().ios_os_name(split_name[1]) 96 if not os_name: 97 return None 98 name = split_name[0] + '-' + os_name + ('-' + '-'.join(split_name[2:]) if len(split_name) > 2 else '') 99 return self._filesystem.join(apple_additions().layout_tests_path(), name) 100 101 @memoized 89 102 def default_baseline_search_path(self): 90 103 wk_string = 'wk1' … … 92 105 wk_string = 'wk2' 93 106 fallback_names = [ 107 '{}-{}-{}'.format(self.port_name, self.ios_version().split('.')[0], wk_string), 108 '{}-{}'.format(self.port_name, self.ios_version().split('.')[0]), 94 109 '{}-{}'.format(self.port_name, wk_string), 95 110 self.port_name, … … 101 116 fallback_names.append('wk2') 102 117 103 return map(self._webkit_baseline_path, fallback_names) 118 webkit_expectations = map(self._webkit_baseline_path, fallback_names) 119 if apple_additions() and getattr(apple_additions(), "layout_tests_path", None): 120 apple_expectations = map(self._apple_additions_path, fallback_names) 121 result = [] 122 for i in xrange(len(webkit_expectations)): 123 if apple_expectations[i]: 124 result.append(apple_expectations[i]) 125 result.append(webkit_expectations[i]) 126 return result 127 return webkit_expectations 104 128 105 129 def test_expectations_file_position(self): -
trunk/Tools/Scripts/webkitpy/port/ios_device_unittest.py
r219875 r221079 27 27 from webkitpy.port.ios_device import IOSDevicePort 28 28 from webkitpy.port import ios_testcase 29 from webkitpy.port import port_testcase 29 30 30 31 … … 89 90 with self.assertRaises(RuntimeError): 90 91 port._get_crash_log('DumpRenderTree', 1234, None, None, time.time(), wait_for_log=False) 92 93 def test_layout_test_searchpath_with_apple_additions(self): 94 with port_testcase.bind_mock_apple_additions(): 95 search_path = self.make_port().default_baseline_search_path() 96 self.assertEqual(search_path[0], '/additional_testing_path/ios-device-11-wk1') 97 self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/ios-device-11-wk1') 98 self.assertEqual(search_path[2], '/additional_testing_path/ios-device-11') 99 self.assertEqual(search_path[3], '/mock-checkout/LayoutTests/platform/ios-device-11') 100 self.assertEqual(search_path[4], '/additional_testing_path/ios-device-wk1') 101 self.assertEqual(search_path[5], '/mock-checkout/LayoutTests/platform/ios-device-wk1') 102 self.assertEqual(search_path[6], '/additional_testing_path/ios-device') 103 self.assertEqual(search_path[7], '/mock-checkout/LayoutTests/platform/ios-device') 104 self.assertEqual(search_path[8], '/additional_testing_path/ios-11') 105 self.assertEqual(search_path[9], '/mock-checkout/LayoutTests/platform/ios-11') 106 self.assertEqual(search_path[10], '/additional_testing_path/ios-wk1') 107 self.assertEqual(search_path[11], '/mock-checkout/LayoutTests/platform/ios-wk1') -
trunk/Tools/Scripts/webkitpy/port/ios_simulator_unittest.py
r217946 r221079 25 25 from webkitpy.port.ios_simulator import IOSSimulatorPort 26 26 from webkitpy.port import ios_testcase 27 from webkitpy.port import port_testcase 27 28 from webkitpy.common.system.outputcapture import OutputCapture 28 29 from webkitpy.tool.mocktool import MockOptions … … 88 89 expected_stdout = "['xcrun', '--sdk', 'iphonesimulator', '-find', 'test']\n" 89 90 OutputCapture().assert_outputs(self, port.xcrun_find, args=['test', 'falling'], expected_stdout=expected_stdout) 91 92 def test_layout_test_searchpath_with_apple_additions(self): 93 with port_testcase.bind_mock_apple_additions(): 94 search_path = self.make_port().default_baseline_search_path() 95 self.assertEqual(search_path[0], '/additional_testing_path/ios-simulator-8-wk1') 96 self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/ios-simulator-8-wk1') 97 self.assertEqual(search_path[2], '/additional_testing_path/ios-simulator-8') 98 self.assertEqual(search_path[3], '/mock-checkout/LayoutTests/platform/ios-simulator-8') 99 self.assertEqual(search_path[4], '/additional_testing_path/ios-simulator-wk1') 100 self.assertEqual(search_path[5], '/mock-checkout/LayoutTests/platform/ios-simulator-wk1') 101 self.assertEqual(search_path[6], '/additional_testing_path/ios-simulator') 102 self.assertEqual(search_path[7], '/mock-checkout/LayoutTests/platform/ios-simulator') 103 self.assertEqual(search_path[8], '/additional_testing_path/ios-8') 104 self.assertEqual(search_path[9], '/mock-checkout/LayoutTests/platform/ios-8') 105 self.assertEqual(search_path[10], '/additional_testing_path/ios-wk1') 106 self.assertEqual(search_path[11], '/mock-checkout/LayoutTests/platform/ios-wk1') -
trunk/Tools/Scripts/webkitpy/port/mac.py
r219507 r221079 35 35 from webkitpy.common.memoized import memoized 36 36 from webkitpy.common.system.executive import ScriptError 37 from webkitpy.port.config import apple_additions 37 38 from webkitpy.port.darwin import DarwinPort 38 39 … … 56 57 def _build_driver_flags(self): 57 58 return ['ARCHS=i386'] if self.architecture() == 'x86' else [] 59 60 def _apple_additions_path(self, name): 61 if name == 'wk2': 62 return None 63 split_name = name.split('-') 64 if len(split_name) > 1 and split_name[1] != 'wk1' and split_name[1] != 'wk2': 65 os_name = apple_additions().mac_os_name(split_name[1]) 66 if not os_name: 67 return None 68 name = split_name[0] + '-' + os_name + ('-' + '-'.join(split_name[2:])) if len(split_name) > 2 else '' 69 return self._filesystem.join(apple_additions().layout_tests_path(), name) 58 70 59 71 @memoized … … 71 83 fallback_names.append('wk2') 72 84 73 return map(self._webkit_baseline_path, fallback_names) 85 webkit_expectations = map(self._webkit_baseline_path, fallback_names) 86 if apple_additions() and getattr(apple_additions(), "layout_tests_path", None): 87 apple_expectations = map(self._apple_additions_path, fallback_names) 88 result = [] 89 for i in xrange(len(webkit_expectations)): 90 if apple_expectations[i]: 91 result.append(apple_expectations[i]) 92 result.append(webkit_expectations[i]) 93 return result 94 return webkit_expectations 74 95 75 96 def configuration_specifier_macros(self): -
trunk/Tools/Scripts/webkitpy/port/mac_unittest.py
r219507 r221079 32 32 from webkitpy.port.mac import MacPort 33 33 from webkitpy.port import darwin_testcase 34 from webkitpy. common.system.filesystem_mock import MockFileSystem34 from webkitpy.port import port_testcase 35 35 from webkitpy.common.system.outputcapture import OutputCapture 36 36 from webkitpy.tool.mocktool import MockOptions 37 from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2, MockProcess, ScriptError 38 from webkitpy.common.system.systemhost_mock import MockSystemHost 39 37 from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2, ScriptError 40 38 41 39 class MacTest(darwin_testcase.DarwinTest): … … 145 143 expected_stdout = "['xcrun', '--sdk', 'macosx', '-find', 'test']\n" 146 144 OutputCapture().assert_outputs(self, port.xcrun_find, args=['test', 'falling'], expected_stdout=expected_stdout) 145 146 def test_layout_test_searchpath_with_apple_additions(self): 147 with port_testcase.bind_mock_apple_additions(): 148 search_path = self.make_port().default_baseline_search_path() 149 self.assertEqual(search_path[0], '/additional_testing_path/mac-lion-wk1') 150 self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/mac-lion-wk1') -
trunk/Tools/Scripts/webkitpy/port/port_testcase.py
r215727 r221079 38 38 import unittest 39 39 40 from contextlib import contextmanager 41 40 42 from webkitpy.common.system.executive_mock import MockExecutive 41 43 from webkitpy.common.system.filesystem_mock import MockFileSystem … … 43 45 from webkitpy.common.system.systemhost_mock import MockSystemHost 44 46 from webkitpy.port.base import Port 47 from webkitpy.port.config import apple_additions 45 48 from webkitpy.port.image_diff import ImageDiffer 46 49 from webkitpy.port.server_process_mock import MockServerProcess … … 72 75 def _tests_for_disabled_features(self): 73 76 return ["accessibility", ] 77 78 79 @contextmanager 80 def bind_mock_apple_additions(): 81 82 class MockAppleAdditions(object): 83 84 @staticmethod 85 def layout_tests_path(): 86 return '/additional_testing_path/' 87 88 @staticmethod 89 def ios_os_name(name): 90 return name 91 92 @staticmethod 93 def mac_os_name(name): 94 return name 95 96 # apple_additions is a memoized function. Take advantage of this fact and manipulate the cache 97 # to temporarily return a mocked result 98 apple_additions._results_cache[()] = MockAppleAdditions 99 yield 100 apple_additions._results_cache[()] = None 74 101 75 102 -
trunk/Tools/Scripts/webkitpy/port/win.py
r219657 r221079 41 41 from webkitpy.common.system.path import abspath_to_uri, cygpath 42 42 from webkitpy.port.apple import ApplePort 43 43 from webkitpy.port.config import apple_additions 44 44 45 45 _log = logging.getLogger(__name__) … … 114 114 # FIXME: Perhaps we should get this list from MacPort? 115 115 fallback_names.append('mac') 116 return map(self._webkit_baseline_path, fallback_names) 116 result = map(self._webkit_baseline_path, fallback_names) 117 if apple_additions() and getattr(apple_additions(), "layout_tests_path", None): 118 result.insert(0, self._filesystem.join(apple_additions().layout_tests_path(), self.port_name)) 119 return result 117 120 118 121 def setup_environ_for_server(self, server_name=None): -
trunk/Tools/Scripts/webkitpy/port/win_unittest.py
r187908 r221079 27 27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 29 import StringIO 30 import unittest 31 32 from webkitpy.common.system.executive import ScriptError 33 from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2 34 from webkitpy.common.system.filesystem_mock import MockFileSystem 29 from webkitpy.common.system.executive_mock import MockExecutive 35 30 from webkitpy.common.system.outputcapture import OutputCapture 36 31 from webkitpy.common.system.systemhost_mock import MockSystemHost … … 117 112 port._get_crash_log('DumpRenderTree', 1234, '', '', 0, 118 113 time_fn=fake_time_cb(), sleep_fn=lambda delay: None) 114 115 def test_layout_test_searchpath_with_apple_additions(self): 116 with port_testcase.bind_mock_apple_additions(): 117 search_path = self.make_port().default_baseline_search_path() 118 self.assertEqual(search_path[0], '/additional_testing_path/win') 119 self.assertEqual(search_path[1], '/mock-checkout/LayoutTests/platform/win-xp')
Note: See TracChangeset
for help on using the changeset viewer.