Changeset 178757 in webkit
- Timestamp:
- Jan 20, 2015 2:43:36 PM (9 years ago)
- Location:
- trunk/Tools
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r178720 r178757 1 2015-01-20 Jake Nielsen <jacob_nielsen@apple.com> 2 3 Fix EWS python unit tests and address code comments as per 140476 4 https://bugs.webkit.org/show_bug.cgi?id=140637 5 6 Reviewed by David Kilzer. 7 8 * Scripts/webkitpy/port/base.py: 9 (Port): 10 (Port.__init__): 11 Adds DEFAULT_ARCHITECTURE member. 12 (Port.architecture): 13 Removes architecture member and instead uses 14 self.get_option('architecture'). Also removes redundant architecture 15 method. 16 (Port.set_architecture): 17 Adds a setter for the architecture variable to be able to set a flag 18 upon modification. 19 (Port.test_configuration): 20 Uses self.architecture() instead of self._architecture. 21 * Scripts/webkitpy/port/ios.py: 22 Overrides DEFAULT_ARCHITECTURE. 23 (IOSPort): 24 (IOSPort.determine_full_port_name): 25 Uses subprocess.check_output instead of Popen. Uses rstrip instead of 26 strip. Fixes regex to not match arbitrary characters after the 27 relevent digits are matched. 28 (IOSPort.__init__): 29 Removes old _architecture defaulting strategy. 30 (IOSPort._build_driver_flags): 31 Uses self.architecture() instead of self._architecture. 32 (IOSSimulatorPort): 33 Overrides DEFAULT_ARCHITECTURE. 34 (IOSSimulatorPort.__init__): 35 Removes old _architecture defaulting strategy. 36 * Scripts/webkitpy/port/mac.py: 37 (MacPort): 38 Overrides DEFAULT_ARCHITECTURE. 39 (MacPort.__init__): 40 Removes old _architecture defaulting strategy. 41 * Scripts/webkitpy/tool/commands/earlywarningsystem.py: 42 (AbstractEarlyWarningSystem.run_command): 43 Checks the did_override_architecture flag to determine whether to add 44 the --architecture option. 45 * Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py: 46 Uses ews.architecture rather than trying to discern the correct 47 architecture using a port object. 48 (EarlyWarningSystemTest._default_expected_logs): 49 * Scripts/webkitpy/tool/commands/queues.py: 50 Removes use of optparse, and removes the import statement. 51 (AbstractQueue.__init__): 52 (PatchProcessingQueue.begin_work_queue): 53 1 54 2015-01-20 Sam Weinig <sam@webkit.org> 2 55 -
trunk/Tools/Scripts/webkitpy/port/base.py
r178622 r178757 79 79 ALL_BUILD_TYPES = ('debug', 'release') 80 80 81 DEFAULT_ARCHITECTURE = 'x86' 82 81 83 @classmethod 82 84 def determine_full_port_name(cls, host, options, port_name): … … 97 99 # These are default values that should be overridden in a subclasses. 98 100 self._version = '' 99 self._architecture = 'x86' 101 102 # FIXME: This can be removed once default architectures for GTK and EFL EWS bots are set. 103 self.did_override_architecture = False 100 104 101 105 # FIXME: Ideally we'd have a package-wide way to get a … … 103 107 # options defined on it. 104 108 self._options = options or optparse.Values() 109 110 if self.get_option('architecture'): 111 self.did_override_architecture = True 112 else: 113 self.set_option('architecture', self.DEFAULT_ARCHITECTURE) 105 114 106 115 if self._name and '-wk2' in self._name: … … 129 138 130 139 def architecture(self): 131 return self._architecture 140 return self.get_option('architecture') 141 142 def set_architecture(self, arch): 143 self.did_override_architecture = True 144 self.set_option('architecture', arch) 132 145 133 146 def additional_drt_flag(self): … … 714 727 return self._version 715 728 716 def architecture(self):717 return self._architecture718 719 729 def get_option(self, name, default_value=None): 720 730 return getattr(self._options, name, default_value) … … 924 934 """Returns the current TestConfiguration for the port.""" 925 935 if not self._test_configuration: 926 self._test_configuration = TestConfiguration(self._version, self. _architecture, self._options.configuration.lower())936 self._test_configuration = TestConfiguration(self._version, self.architecture(), self._options.configuration.lower()) 927 937 return self._test_configuration 928 938 -
trunk/Tools/Scripts/webkitpy/port/ios.py
r178641 r178757 47 47 48 48 ARCHITECTURES = ['armv7', 'armv7s', 'arm64'] 49 VERSION_FALLBACK_ORDER = ['ios-7', 'ios-8'] 49 DEFAULT_ARCHITECTURE = 'armv7' 50 VERSION_FALLBACK_ORDER = ['ios-7', 'ios-8', 'ios-9'] 50 51 51 52 @classmethod … … 54 55 sdk_version = '8.0' 55 56 if host.platform.is_mac(): 56 sdk_command_process = subprocess.Popen('xcrun --sdk iphoneos --show-sdk-version', stdout=subprocess.PIPE, stderr=None, shell=True) 57 sdk_command_output = sdk_command_process.communicate()[0].strip() 57 sdk_command_output = subprocess.check_output(['/usr/bin/xcrun', '--sdk', 'iphoneos', '--show-sdk-version'], stderr=None).rstrip() 58 58 if sdk_command_output: 59 59 sdk_version = sdk_command_output 60 60 61 port_name = port_name + '-' + re.match('^([0-9]+) .*', sdk_version).group(1)61 port_name = port_name + '-' + re.match('^([0-9]+)', sdk_version).group(1) 62 62 63 63 return port_name … … 66 66 super(IOSPort, self).__init__(*args, **kwargs) 67 67 68 self._architecture = self.get_option('architecture')69 70 if not self._architecture:71 self._architecture = 'armv7'72 73 68 self._testing_device = None 74 69 75 70 # Despite their names, these flags do not actually get passed all the way down to webkit-build. 76 71 def _build_driver_flags(self): 77 return ['--sdk', 'iphoneos'] + (['ARCHS=%s' % self. _architecture] if self._architectureelse [])72 return ['--sdk', 'iphoneos'] + (['ARCHS=%s' % self.architecture()] if self.architecture() else []) 78 73 79 74 def operating_system(self): … … 88 83 ARCHITECTURES = ['x86_64', 'x86'] 89 84 85 DEFAULT_ARCHITECTURE = 'x86_64' 86 90 87 relay_name = 'LayoutTestRelay' 91 88 92 89 def __init__(self, *args, **kwargs): 93 90 super(IOSSimulatorPort, self).__init__(*args, **kwargs) 94 95 self._architecture = self.get_option('architecture')96 97 if not self._architecture:98 self._architecture = 'x86_64'99 91 100 92 self._leak_detector = LeakDetector(self) -
trunk/Tools/Scripts/webkitpy/port/mac.py
r177028 r178757 49 49 ARCHITECTURES = ['x86_64', 'x86'] 50 50 51 DEFAULT_ARCHITECTURE = 'x86_64' 52 51 53 def __init__(self, host, port_name, **kwargs): 52 54 ApplePort.__init__(self, host, port_name, **kwargs) 53 self._architecture = self.get_option('architecture')54 55 if not self._architecture:56 self._architecture = 'x86_64'57 55 58 56 self._leak_detector = LeakDetector(self) -
trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem.py
r178622 r178757 109 109 110 110 def run_command(self, command): 111 self.run_webkit_patch(command + [self._deprecated_port.flag()] + (['--architecture=%s' % self._port.architecture()] if self._port.architecture() else []))111 self.run_webkit_patch(command + [self._deprecated_port.flag()] + (['--architecture=%s' % self._port.architecture()] if self._port.architecture() and self._port.did_override_architecture else [])) 112 112 113 113 def command_passed(self, message, patch): -
trunk/Tools/Scripts/webkitpy/tool/commands/earlywarningsystem_unittest.py
r178622 r178757 61 61 class EarlyWarningSystemTest(QueuesTest): 62 62 def _default_expected_logs(self, ews): 63 host = Host()64 real_port_name = PatchProcessingQueue()._new_port_name_from_old(ews.port_name, host.platform)65 real_port = Host().port_factory.get(real_port_name)66 63 string_replacements = { 67 64 "name": ews.name, 68 65 "port": ews.port_name, 69 "architecture": real_port.architecture(),66 "architecture": " --architecture=%s" % ews.architecture if ews.architecture else "", 70 67 } 71 68 if ews.run_tests: 72 run_tests_line = "Running: webkit-patch --status-host=example.com build-and-test --no-clean --no-update --test --non-interactive --port=%(port)s --architecture=%(architecture)s\n" % string_replacements69 run_tests_line = "Running: webkit-patch --status-host=example.com build-and-test --no-clean --no-update --test --non-interactive --port=%(port)s%(architecture)s\n" % string_replacements 73 70 else: 74 71 run_tests_line = "" … … 77 74 expected_logs = { 78 75 "begin_work_queue": self._default_begin_work_queue_logs(ews.name), 79 "process_work_item": """Running: webkit-patch --status-host=example.com clean --port=%(port)s --architecture=%(architecture)s80 Running: webkit-patch --status-host=example.com update --port=%(port)s --architecture=%(architecture)s81 Running: webkit-patch --status-host=example.com apply-attachment --no-update --non-interactive 10000 --port=%(port)s --architecture=%(architecture)s82 Running: webkit-patch --status-host=example.com build --no-clean --no-update --build-style=release --port=%(port)s --architecture=%(architecture)s76 "process_work_item": """Running: webkit-patch --status-host=example.com clean --port=%(port)s%(architecture)s 77 Running: webkit-patch --status-host=example.com update --port=%(port)s%(architecture)s 78 Running: webkit-patch --status-host=example.com apply-attachment --no-update --non-interactive 10000 --port=%(port)s%(architecture)s 79 Running: webkit-patch --status-host=example.com build --no-clean --no-update --build-style=release --port=%(port)s%(architecture)s 83 80 %(run_tests_line)sMOCK: update_status: %(name)s Pass 84 81 MOCK: release_work_item: %(name)s 10000 -
trunk/Tools/Scripts/webkitpy/tool/commands/queues.py
r178622 r178757 30 30 import codecs 31 31 import logging 32 import optparse33 32 import os 34 33 import re … … 76 75 Command.__init__(self, options=options_list) 77 76 self._iteration_count = 0 78 self.architecture = None 77 if not hasattr(self, 'architecture'): 78 self.architecture = None 79 79 80 80 def _cc_watchers(self, bug_id): … … 278 278 # FIXME: This violates abstraction 279 279 self._tool._deprecated_port = self._deprecated_port 280 port_options = optparse.Values() 280 281 self._port = self._tool.port_factory.get(self._new_port_name_from_old(self.port_name, self._tool.platform)) 281 282 if self.architecture: 282 setattr(port_options, 'architecture', self.architecture) 283 self._port = self._tool.port_factory.get(self._new_port_name_from_old(self.port_name, self._tool.platform), port_options) 283 self._port.set_architecture(self.architecture) 284 284 285 285 def _upload_results_archive_for_patch(self, patch, results_archive_zip):
Note: See TracChangeset
for help on using the changeset viewer.