Bug 140637

Summary: Fix EWS python unit tests and address code comments as per 140476
Product: WebKit Reporter: Jake Nielsen <jake.nielsen.webkit>
Component: Tools / TestsAssignee: Jake Nielsen <jake.nielsen.webkit>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, cgarcia, commit-queue, dbates, ddkilzer, glenn, gyuyoung.kim, mrobinson
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 140476    
Bug Blocks: 140787    
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Jake Nielsen
Reported 2015-01-19 12:54:38 PST
Fix EWS python unit tests and address code comments as per 140476
Attachments
Patch (11.78 KB, patch)
2015-01-19 13:05 PST, Jake Nielsen
no flags
Patch (13.95 KB, patch)
2015-01-19 17:37 PST, Jake Nielsen
no flags
Patch (13.85 KB, patch)
2015-01-20 13:55 PST, Jake Nielsen
no flags
Jake Nielsen
Comment 1 2015-01-19 13:05:17 PST
Jake Nielsen
Comment 2 2015-01-19 13:09:33 PST
Martin/Carlos, is the default architecture in ews.json correct for GTK? Gyuyoung, is the default correct for EFL?
Daniel Bates
Comment 3 2015-01-19 14:24:15 PST
Comment on attachment 244920 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244920&action=review I'm unclear why we need logic for the default architecture as opposed to letting the tools that the EWS call (e.g. build-webkit) determine the default architecture. Is it not sufficient to only teach webkit-patch and the EWS to pass the specified architecture (given as a command line argument when you start the EWS) to the tools is calls? I mean, it seems weird that we have logic to determine the default architecture for the EWS code given that we have existing logic to compute a default architecture in webkitdirs.pm, which is used by build-webkit and other Perl tools. > Tools/Scripts/webkitpy/common/config/ews.json:4 > + "architecture": "x86", We'll need to confirm this. > Tools/Scripts/webkitpy/common/config/ews.json:11 > + "architecture": "x86", Ditto. > Tools/Scripts/webkitpy/common/config/ews.json:18 > + "architecture": "x86" I'm surprised we don't have 64-bit hardware. > Tools/Scripts/webkitpy/port/base.py:108 > + if not self.get_option('architecture'): > + self.set_option('architecture', self.DEFAULT_ARCHITECTURE) We can simplify this code by taking advantage of the convenience function set_option_default() that conditionally sets the value of the specified attribute to the specified value if it doesn't already have a value. self.set_option_default('architecture', self.DEFAULT_ARCHITECTURE) > Tools/Scripts/webkitpy/tool/commands/queues.py:77 > + if not hasattr(self, 'architecture'): How did you come to the decision to check for the existence of the attribute architecture as opposed to setting it directly? I take it you're worried about the order of calling super() in a derived class?
Jake Nielsen
Comment 4 2015-01-19 17:25:46 PST
(In reply to comment #3) > Comment on attachment 244920 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=244920&action=review > > I'm unclear why we need logic for the default architecture as opposed to > letting the tools that the EWS call (e.g. build-webkit) determine the > default architecture. Is it not sufficient to only teach webkit-patch and > the EWS to pass the specified architecture (given as a command line argument > when you start the EWS) to the tools is calls? I mean, it seems weird that > we have logic to determine the default architecture for the EWS code given > that we have existing logic to compute a default architecture in > webkitdirs.pm, which is used by build-webkit and other Perl tools. > > > Tools/Scripts/webkitpy/common/config/ews.json:4 > > + "architecture": "x86", > > We'll need to confirm this. > > > Tools/Scripts/webkitpy/common/config/ews.json:11 > > + "architecture": "x86", > > Ditto. > > > Tools/Scripts/webkitpy/common/config/ews.json:18 > > + "architecture": "x86" > > I'm surprised we don't have 64-bit hardware. ^ I'll remove these from ews.json > > > Tools/Scripts/webkitpy/port/base.py:108 > > + if not self.get_option('architecture'): > > + self.set_option('architecture', self.DEFAULT_ARCHITECTURE) > > We can simplify this code by taking advantage of the convenience function > set_option_default() that conditionally sets the value of the specified > attribute to the specified value if it doesn't already have a value. > > self.set_option_default('architecture', self.DEFAULT_ARCHITECTURE) I agree, that is simpler. Unfortunately we now need a state variable, so we're going to need to check for the existence of the architecture option anyway. > > > Tools/Scripts/webkitpy/tool/commands/queues.py:77 > > + if not hasattr(self, 'architecture'): > > How did you come to the decision to check for the existence of the attribute > architecture as opposed to setting it directly? I take it you're worried > about the order of calling super() in a derived class? Yes. In particular when the EarlyWarningSystem classes are dynamically created, they are created with the architecture attribute before the initializer runs. Without this check they get set to None erroneously.
Jake Nielsen
Comment 5 2015-01-19 17:37:21 PST
David Kilzer (:ddkilzer)
Comment 6 2015-01-20 10:36:04 PST
Comment on attachment 244944 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244944&action=review r=me with the suggested fixes. > Tools/Scripts/webkitpy/port/base.py:104 > + # This member variable shouldn't have to exist, but it will be needed until the correct > + # default architectures for the GTK and EFL EWS bots are known. > + # FIXME: Remove this member variable. Please reword this as: # FIXME: This can be removed once default architectures for GTK and EFL EWS bots are set. > Tools/Scripts/webkitpy/port/base.py:105 > + self.did_override_architecture = True Please set this to False by default, and only set it to true when the setter is called. > Tools/Scripts/webkitpy/port/base.py:113 > + self.did_override_architecture = False Remove this line if self.did_override_architecture defaults to False. > Tools/Scripts/webkitpy/port/ios.py:49 > + VERSION_FALLBACK_ORDER = ['ios-7', 'ios-8', 'ios-9'] Remove 'ios-9' here since we don't need a fallback for ios-9 until ios-10 exists. > Tools/Scripts/webkitpy/port/ios.py:50 > + DEFAULT_ARCHITECTURE = 'armv7' Nit: Put this after ARCHITECTURES but before VERSION_FALLBACK_ORDER. > Tools/Scripts/webkitpy/tool/commands/queues.py:282 > + self._port.set_architecture(self.architecture) Should probably only set this if self.architecture is not None? if self.architecture: self._port.set_architecture(self.architecture)
Jake Nielsen
Comment 7 2015-01-20 13:55:16 PST
David Kilzer (:ddkilzer)
Comment 8 2015-01-20 14:01:03 PST
Comment on attachment 245015 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=245015&action=review r=me > Tools/Scripts/webkitpy/port/ios.py:50 > + VERSION_FALLBACK_ORDER = ['ios-7', 'ios-8', 'ios-9'] Talked to Jake in person; it's fine to add this for now.
WebKit Commit Bot
Comment 9 2015-01-20 14:43:48 PST
Comment on attachment 245015 [details] Patch Clearing flags on attachment: 245015 Committed r178757: <http://trac.webkit.org/changeset/178757>
WebKit Commit Bot
Comment 10 2015-01-20 14:43:55 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.