Bug 204227 - Python 3: Add support in webkitpy.layout_tests.views
Summary: Python 3: Add support in webkitpy.layout_tests.views
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: InRadar
Depends on:
Blocks:
 
Reported: 2019-11-15 08:53 PST by Jonathan Bedard
Modified: 2019-11-18 12:55 PST (History)
6 users (show)

See Also:


Attachments
Patch (19.48 KB, patch)
2019-11-15 14:26 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 2019-11-15 08:53:36 PST
Add Python 3 support to layout test logging.
Comment 1 Jonathan Bedard 2019-11-15 14:26:36 PST
Created attachment 383650 [details]
Patch
Comment 2 Dean Johnson 2019-11-18 11:42:21 PST
Comment on attachment 383650 [details]
Patch

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

LGTM overall w/ a question. Unofficial r+.

> Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py:169
> +        printer._meter.number_of_columns = lambda: sys.maxsize

Does this exist in both py2 and py3?
Comment 3 Jonathan Bedard 2019-11-18 11:48:51 PST
(In reply to Dean Johnson from comment #2)
> Comment on attachment 383650 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=383650&action=review
> 
> LGTM overall w/ a question. Unofficial r+.
> 
> > Tools/Scripts/webkitpy/layout_tests/views/printing_unittest.py:169
> > +        printer._meter.number_of_columns = lambda: sys.maxsize
> 
> Does this exist in both py2 and py3?

Yes. maxint doesn't exist in Python 3, maxsize is 9223372036854775807 in both Python 2 and Python 3, maxint is also 9223372036854775807 in Python 2.
Comment 4 Aakash Jain 2019-11-18 11:51:14 PST
Comment on attachment 383650 [details]
Patch

Does it passing webkitpy ews indicates that these updated tests were run through EWS (for Python 2)?
Comment 5 Jonathan Bedard 2019-11-18 11:55:12 PST
(In reply to Aakash Jain from comment #4)
> Comment on attachment 383650 [details]
> Patch
> 
> Does it passing webkitpy ews indicates that these updated tests were run
> through EWS (for Python 2)?

Yes!

And actually, the new tests are pretty similar to the old ones. The big difference is that we were essentially introspecting buflist on the StringIO object so avoid concatenating unicode and non-unicode strings. In most cases, we could safely join the StringIO buffers (and we can always join them in Python 3) so with a few notable unicode exceptions, that's what the new unit tests are doing.

Some added comfort here, we passed api and layout tests which are also leveraging Python 2 webkitpy code.
Comment 6 WebKit Commit Bot 2019-11-18 12:53:56 PST
The commit-queue encountered the following flaky tests while processing attachment 383650 [details]:

imported/w3c/web-platform-tests/svg/import/struct-dom-06-b-manual.svg bug 204312 (author: sabouhallawa@apple.com)
The commit-queue is continuing to process your patch.
Comment 7 WebKit Commit Bot 2019-11-18 12:54:48 PST
Comment on attachment 383650 [details]
Patch

Clearing flags on attachment: 383650

Committed r252560: <https://trac.webkit.org/changeset/252560>
Comment 8 WebKit Commit Bot 2019-11-18 12:54:49 PST
All reviewed patches have been landed.  Closing bug.
Comment 9 Radar WebKit Bug Importer 2019-11-18 12:55:30 PST
<rdar://problem/57293904>