Bug 168394 - webkitpy: Regular expression for parsing simctl device information is wrong for iPad Pro
Summary: webkitpy: Regular expression for parsing simctl device information is wrong f...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-15 15:04 PST by Jonathan Bedard
Modified: 2017-02-28 12:53 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.35 KB, patch)
2017-02-15 15:07 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch (6.40 KB, patch)
2017-02-21 16:38 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff
Patch for landing (6.34 KB, patch)
2017-02-28 12:11 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2017-02-15 15:04:47 PST
Simulated iPad Pro look have parenthesis in their names when listed through xcrun simctl list.  An example of an iPad Pro simulator name is bellow:
    iPad Pro (9.7 inch) (udid) (state)

The regular expression which parses these lines does not consider devices with names which have parenthesis in them.
Comment 1 Jonathan Bedard 2017-02-15 15:07:04 PST
Created attachment 301660 [details]
Patch
Comment 2 Alexey Proskuryakov 2017-02-21 09:06:47 PST
Comment on attachment 301660 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=301660&action=review

> Tools/Scripts/webkitpy/xcode/simulator.py:344
> -        '\s*(?P<name>[^(]+ )\((?P<udid>[^)]+)\) \((?P<state>[^)]+)\)( \((?P<availability>[^)]+)\))?')
> +        '\s*(?P<name>.+) \((?P<udid>[^)]+)\) \((?P<state>[^)]+)\)( \((?P<availability>[^)]+)\))?')

Is this testable?
Comment 3 Alexey Proskuryakov 2017-02-21 09:09:37 PST
Ideally, we should switch to JSON, not polish text output parsing.
Comment 4 Jonathan Bedard 2017-02-21 13:51:32 PST
(In reply to comment #3)
> Ideally, we should switch to JSON, not polish text output parsing.

I agree that the JSON would be preferable, but I also think that we should at least fix this regular expression temporarily.  It will be a few more weeks before the JSON change gets made, and currently, many of the default iPad names do not fit into our regular expression.
Comment 5 Jonathan Bedard 2017-02-21 16:38:30 PST
Created attachment 302336 [details]
Patch
Comment 6 Daniel Bates 2017-02-28 11:33:39 PST
Comment on attachment 302336 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=302336&action=review

> Tools/ChangeLog:3
> +        webkitpy: Regular expression for parsing simctl device information is wrong for iPad pros

iPad pros => iPad Pro
Comment 7 Jonathan Bedard 2017-02-28 12:11:34 PST
Created attachment 302965 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2017-02-28 12:53:41 PST
Comment on attachment 302965 [details]
Patch for landing

Clearing flags on attachment: 302965

Committed r213164: <http://trac.webkit.org/changeset/213164>
Comment 9 WebKit Commit Bot 2017-02-28 12:53:46 PST
All reviewed patches have been landed.  Closing bug.