Bug 226230

Summary: webkit-patch haslanded test failing
Product: WebKit Reporter: Sam Sneddon [:gsnedders] <gsnedders>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: jbedard, 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=226017
https://bugs.webkit.org/show_bug.cgi?id=221991

Description Sam Sneddon [:gsnedders] 2021-05-25 12:18:18 PDT
These are currently gated on @unittest.skipUnless(subprocess.call('which interdiff', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0, "requires interdiff"), but currently gives:

gsnedders@gsnedders-milk webkitpy % interdiff --version
interdiff - patchutils version 0.4.2
gsnedders@gsnedders-milk webkitpy % tox -e py27,py38 -- -k haslanded
py27 installed: DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.,apipkg==1.5,atomicwrites==1.4.0,attrs==21.2.0,backports.functools-lru-cache==1.6.4,configparser==4.0.2,contextlib2==0.6.0.post1,execnet==1.8.0,funcsigs==1.0.2,importlib-metadata==2.1.1,more-itertools==5.0.0,packaging==20.9,pathlib2==2.3.5,pluggy==0.13.1,py==1.10.0,pyparsing==2.4.7,pytest==4.6.11,pytest-forked==1.3.0,pytest-xdist==1.34.0,scandir==1.10.0,six==1.16.0,wcwidth==0.2.5,zipp==1.2.0
py27 run-test-pre: PYTHONHASHSEED='0'
py27 run-test: commands[0] | pytest -k haslanded
=================================================================== test session starts ===================================================================
platform darwin -- Python 2.7.16, pytest-4.6.11, py-1.10.0, pluggy-0.13.1
cachedir: .tox/py27/.pytest_cache
rootdir: /Volumes/gsnedders/projects/Safari/OpenSource-Python/Tools/Scripts/webkitpy, inifile: pytest.ini
plugins: xdist-1.34.0, forked-1.3.0
collected 1983 items / 1981 deselected / 2 selected                                                                                                       

tool/steps/haslanded_unittest.py .F                                                                                                                 [100%]

======================================================================== FAILURES =========================================================================
_________________________________________________________________ HasLandedTest.test_run __________________________________________________________________

self = <webkitpy.tool.steps.haslanded_unittest.HasLandedTest testMethod=test_run>

        @unittest.skipUnless(subprocess.call('which interdiff', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0, "requires interdiff")
        def test_run(self):
            # These patches require trailing whitespace to remain valid patches.
            diff1 = """\
    Index: a.py
    ===================================================================
    --- a.py
    +++ a.py
    @@ -1,3 +1,5 @@
     A
     B
     C
    +D
    +E
    Index: b.py
    ===================================================================
    --- b.py      2013-01-21 15:20:59.693887185 +1100
    +++ b.py      2013-01-21 15:22:24.382555711 +1100
    @@ -1,3 +1,5 @@
     1
     2
     3
    +4
    +5
    """
    
            diff1_add_line = """\
    Index: a.py
    ===================================================================
    --- a.py
    +++ a.py
    @@ -1,3 +1,6 @@
     A
     B
     C
    +D
    +E
    +F
    Index: b.py
    ===================================================================
    --- b.py
    +++ b.py
    @@ -1,3 +1,5 @@
     1
     2
     3
    +4
    +5
    """
    
            diff1_remove_line = """\
    Index: a.py
    ===================================================================
    --- a.py
    +++ a.py
    @@ -1,3 +1,4 @@
     A
     B
     C
    +D
    Index: b.py
    ===================================================================
    --- b.py
    +++ b.py
    @@ -1,3 +1,5 @@
     1
     2
     3
    +4
    +5
    """
    
            diff1_add_file = diff1 + """\
    Index: c.py
    ===================================================================
    --- c.py
    +++ c.py
    @@ -1,3 +1,5 @@
     1
     2
     3
    +4
    +5
    """
    
            diff1_remove_file = """\
    Index: a.py
    ===================================================================
    --- a.py
    +++ a.py
    @@ -1,3 +1,5 @@
     A
     B
     C
    +D
    +E
    """
            self.assertMultiLineEqual(
                HasLanded.diff_diff(diff1, diff1_add_line, '', 'add-line'),
                """\
    diff -u a.py a.py
    --- a.py
    +++ a.py
    @@ -5,0 +6 @@
    +F
>   """)
E   AssertionError: 'diff -u a.py a.py\n--- a.py\n+++ a.py\n@@ -3,3 +3,4 @@\n C\n D\n E\n+F\n' != 'diff -u a.py a.py\n--- a.py\n+++ a.py\n@@ -5,0 +6 @@\n+F\n'
E     diff -u a.py a.py
E     --- a.py
E     +++ a.py
E   + @@ -5,0 +6 @@
E   - @@ -3,3 +3,4 @@
E   -  C
E   -  D
E   -  E
E     +F

tool/steps/haslanded_unittest.py:143: AssertionError
================================================================= short test summary info =================================================================
FAILED tool/steps/haslanded_unittest.py::HasLandedTest::test_run - AssertionError: 'diff -u a.py a.py\n--- a.py\n+++ a.py\n@@ -3,3 +3,4 @@\n C\n D\n E\n...
================================================== 1 failed, 1 passed, 1981 deselected in 12.63 seconds ===================================================
ERROR: InvocationError for command /Volumes/gsnedders/projects/Safari/OpenSource-Python/Tools/Scripts/webkitpy/.tox/py27/bin/pytest -k haslanded (exited with code 1)
py38 installed: apipkg==1.5,attrs==21.2.0,execnet==1.8.0,iniconfig==1.1.1,packaging==20.9,pluggy==0.13.1,py==1.10.0,pyparsing==2.4.7,pytest==6.2.4,pytest-forked==1.3.0,pytest-xdist==2.2.1,toml==0.10.2
py38 run-test-pre: PYTHONHASHSEED='3930572125'
py38 run-test: commands[0] | pytest -k haslanded
=================================================================== test session starts ===================================================================
platform darwin -- Python 3.8.2, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
cachedir: .tox/py38/.pytest_cache
rootdir: /Volumes/gsnedders/projects/Safari/OpenSource-Python/Tools/Scripts/webkitpy, configfile: pytest.ini
plugins: xdist-2.2.1, forked-1.3.0
collected 1983 items / 1981 deselected / 2 selected                                                                                                       

tool/steps/haslanded_unittest.py .F                                                                                                                 [100%]

======================================================================== FAILURES =========================================================================
_________________________________________________________________ HasLandedTest.test_run __________________________________________________________________

self = <webkitpy.tool.steps.haslanded_unittest.HasLandedTest testMethod=test_run>

        @unittest.skipUnless(subprocess.call('which interdiff', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0, "requires interdiff")
        def test_run(self):
            # These patches require trailing whitespace to remain valid patches.
            diff1 = """\
    Index: a.py
    ===================================================================
    --- a.py
    +++ a.py
    @@ -1,3 +1,5 @@
     A
     B
     C
    +D
    +E
    Index: b.py
    ===================================================================
    --- b.py      2013-01-21 15:20:59.693887185 +1100
    +++ b.py      2013-01-21 15:22:24.382555711 +1100
    @@ -1,3 +1,5 @@
     1
     2
     3
    +4
    +5
    """
    
            diff1_add_line = """\
    Index: a.py
    ===================================================================
    --- a.py
    +++ a.py
    @@ -1,3 +1,6 @@
     A
     B
     C
    +D
    +E
    +F
    Index: b.py
    ===================================================================
    --- b.py
    +++ b.py
    @@ -1,3 +1,5 @@
     1
     2
     3
    +4
    +5
    """
    
            diff1_remove_line = """\
    Index: a.py
    ===================================================================
    --- a.py
    +++ a.py
    @@ -1,3 +1,4 @@
     A
     B
     C
    +D
    Index: b.py
    ===================================================================
    --- b.py
    +++ b.py
    @@ -1,3 +1,5 @@
     1
     2
     3
    +4
    +5
    """
    
            diff1_add_file = diff1 + """\
    Index: c.py
    ===================================================================
    --- c.py
    +++ c.py
    @@ -1,3 +1,5 @@
     1
     2
     3
    +4
    +5
    """
    
            diff1_remove_file = """\
    Index: a.py
    ===================================================================
    --- a.py
    +++ a.py
    @@ -1,3 +1,5 @@
     A
     B
     C
    +D
    +E
    """
            self.assertMultiLineEqual(
>               HasLanded.diff_diff(diff1, diff1_add_line, '', 'add-line'),
                """\
    diff -u a.py a.py
    --- a.py
    +++ a.py
    @@ -5,0 +6 @@
    +F
    """)

tool/steps/haslanded_unittest.py:136: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tool/steps/haslanded.py:69: in diff_diff
    diff1_patch.write(diff1)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

args = ('Index: a.py\n===================================================================\n--- a.py\n+++ a.py\n@@ -1,3 +1,5 @...1 15:20:59.693887185 +1100\n+++ b.py      2013-01-21 15:22:24.382555711 +1100\n@@ -1,3 +1,5 @@\n 1\n 2\n 3\n+4\n+5\n',)
kwargs = {}

    @_functools.wraps(func)
    def func_wrapper(*args, **kwargs):
>       return func(*args, **kwargs)
E       TypeError: a bytes-like object is required, not 'str'

/AppleInternal/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/tempfile.py:474: TypeError
================================================================= short test summary info =================================================================
FAILED tool/steps/haslanded_unittest.py::HasLandedTest::test_run - TypeError: a bytes-like object is required, not 'str'
====================================================== 1 failed, 1 passed, 1981 deselected in 1.98s =======================================================
ERROR: InvocationError for command /Volumes/gsnedders/projects/Safari/OpenSource-Python/Tools/Scripts/webkitpy/.tox/py38/bin/pytest -k haslanded (exited with code 1)
_________________________________________________________________________ summary _________________________________________________________________________
ERROR:   py27: commands failed
ERROR:   py38: commands failed
Comment 1 Radar WebKit Bug Importer 2021-06-01 12:19:19 PDT
<rdar://problem/78726646>