Bug 202473

Summary: Python 3: Add support in webkitpy.common.watchlist
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, commit-queue, dean_johnson, dewei_zhu, ews-watchlist, glenn, jbedard, slewis, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=202462
Attachments:
Description Flags
Patch
none
Patch none

Description Jonathan Bedard 2019-10-02 09:12:09 PDT
Add webkitpy.common.watchlist to test-webkitpy-python3
Comment 1 Jonathan Bedard 2019-10-03 11:31:28 PDT
Created attachment 380145 [details]
Patch
Comment 2 Stephanie Lewis 2019-10-16 15:34:58 PDT
why are we removing raw strings?  They don't appear to be different in python3 from a brief look.
Comment 3 Jonathan Bedard 2019-10-16 15:53:27 PDT
(In reply to Stephanie Lewis from comment #2)
> why are we removing raw strings?  They don't appear to be different in
> python3 from a brief look.

Because Python 2 and Python 3 have different rules for \ in r strings.
Comment 4 Jonathan Bedard 2019-10-16 15:54:08 PDT
(In reply to Jonathan Bedard from comment #3)
> (In reply to Stephanie Lewis from comment #2)
> > why are we removing raw strings?  They don't appear to be different in
> > python3 from a brief look.
> 
> Because Python 2 and Python 3 have different rules for \ in r strings.

Totally open to other ideas, but this was the easiest way to get things working in a compatible way.
Comment 5 dewei_zhu 2019-10-17 13:56:03 PDT
Comment on attachment 380145 [details]
Patch

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

> Tools/Scripts/webkitpy/common/watchlist/watchlist_unittest.py:46
> +            '            "filename": ".*\\\\\\\\MyFileName\\\\.cpp",'

Why do we need so may back slashes for first '\\'
Comment 6 Jonathan Bedard 2019-10-17 15:48:34 PDT
Created attachment 381241 [details]
Patch
Comment 7 dewei_zhu 2019-10-18 14:33:39 PDT
Comment on attachment 381241 [details]
Patch

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

> Tools/Scripts/webkitpy/common/watchlist/watchlist_unittest.py:46
> +            '            "filename": r".*MyFileName\\.cpp",'

Can we still use raw string in Python3? Also regex before and after your change are not identical, we usually don't change test case itself when converting to be python3 compatible, do we?
Comment 8 Jonathan Bedard 2019-10-18 14:45:12 PDT
Comment on attachment 381241 [details]
Patch

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

>> Tools/Scripts/webkitpy/common/watchlist/watchlist_unittest.py:46
>> +            '            "filename": r".*MyFileName\\.cpp",'
> 
> Can we still use raw string in Python3? Also regex before and after your change are not identical, we usually don't change test case itself when converting to be python3 compatible, do we?

We can.

The are not identical, not sure why we had \M before, that's a special regex value (Like \s) in Python2, not exactly sure what it does, but we definitely shouldn't  have been using it.
Comment 9 dewei_zhu 2019-10-18 14:52:07 PDT
r=me after discussing with Jonathan in person. It's probably OK to allow `ThisIsMyFileName.cpp` to match (which does not previously) as those are test cases.
Comment 10 WebKit Commit Bot 2019-10-18 16:54:37 PDT
The commit-queue encountered the following flaky tests while processing attachment 381241 [details]:

inspector/console/webcore-logging.html bug 203118 (authors: drousso@apple.com and eric.carlson@apple.com)
The commit-queue is continuing to process your patch.
Comment 11 WebKit Commit Bot 2019-10-18 16:55:26 PDT
Comment on attachment 381241 [details]
Patch

Clearing flags on attachment: 381241

Committed r251312: <https://trac.webkit.org/changeset/251312>
Comment 12 WebKit Commit Bot 2019-10-18 16:55:28 PDT
All reviewed patches have been landed.  Closing bug.
Comment 13 Radar WebKit Bug Importer 2019-10-18 16:56:17 PDT
<rdar://problem/56424838>