Patchwork Failing tests for mercurial 5.4rc0 and python3

login
register
mail settings
Submitter Vladimir Lomov
Date April 23, 2020, 1:56 p.m.
Message ID <20200423135629.GH807@smoon.bkoty.ru>
Download mbox | patch
Permalink /patch/46239/
State New
Headers show

Comments

Vladimir Lomov - April 23, 2020, 1:56 p.m.
Hello,

I want to report about failing tests while building and running mercurial with
python3 (seems only one test connected with python3).

First test: test-merge-tools.t

                                                                                                                                                                                                             
ERROR: test-contrib-emacs.t output changed
==============================================================================

isn't related neither with mercurial or python3 but with Emacs. I'm using
emacs compiled from git repository (28.0.50) and seems related with the Emacs
routines and they output. Still the test might be updated to support upcoming
versions of Emacs.

---
WBR, Vladimir Lomov
Pierre-Yves David - June 9, 2020, 11:54 a.m.
This looks like the merge tool is not properly found. Can you report a 
formal bug on https://bz.mercurial-scm.org/ to start a discussion to 
debug this ?

On 4/23/20 3:56 PM, Vladimir Lomov wrote:
> Hello,
> 
> I want to report about failing tests while building and running mercurial with
> python3 (seems only one test connected with python3).
> 
> First test: test-merge-tools.t
> 
> ==============================================================================
> --- /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-merge-tools.t
> +++ /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-merge-tools.t.err
> @@ -125,7 +125,7 @@
>     $ hg up -qC 1
>     $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
>     merging f
> -  warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
> +  merging f failed!
>     0 files updated, 0 files merged, 0 files removed, 1 files unresolved
>     use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
>     [1]
> @@ -139,7 +139,7 @@
>     $ hg up -qC 1
>     $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
>     merging f
> -  warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
> +  merging f failed!
>     0 files updated, 0 files merged, 0 files removed, 1 files unresolved
>     use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
>     [1]
>                                                                                                                                                                                                               
> ERROR: test-merge-tools.t output changed
> ==============================================================================
> 
> If I understand code correctly, the "warning: conflicts while merging" message
> is in 'mercurial/filemerge.py' in "annotation" (I not familiar enough with
> python to name correctly shown part of the code):
> ==============================================================================
> @internaltool(
>      b'merge',
>      fullmerge,
>      _(
>          b"warning: conflicts while merging %s! "
>          b"(edit, then use 'hg resolve --mark')\n"
>      ),
>      precheck=_mergecheck,
> )
> ==============================================================================
> 
> The "merging f failed" from the same file
> 
> ==============================================================================
> if tool in internals:
>          func = internals[tool]
>          mergetype = func.mergetype
>          onfailure = func.onfailure
>          precheck = func.precheck
>          isexternal = False
>      else:
>          if wctx.isinmemory():
>              func = _xmergeimm
>          else:
>              func = _xmerge
>          mergetype = fullmerge
>          onfailure = _(b"merging %s failed!\n")
>          precheck = None
>          isexternal = True
> ==============================================================================
> 
> function '_filemerge'. I don't known should '@internaltool' work with python3
> or not but code suggests that test would fail even if there is no error due to
> possible branching and _different_ message on failure.
> 
> Second test: test-doctest.py
> 
> ==============================================================================
> --- /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py.out
> +++ /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py.err
> @@ -0,0 +1,9 @@
> +abort: no repository found in '/home/vladimir/tmp/mercurial/src/mercurial-5.4rc0' (.hg not found)!
> +Traceback (most recent call last):
> +  File "/home/vladimir/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py", line 75, in <module>
> +    files = subprocess.check_output(
> +  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
> +    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
> +  File "/usr/lib/python3.8/subprocess.py", line 512, in run
> +    raise CalledProcessError(retcode, process.args,
> +subprocess.CalledProcessError: Command 'hg files --print0 "set:(**.py)"' returned non-zero exit status 255.
>                                                                                                                                                                                                               
> ERROR: test-doctest.py output changed
> ==============================================================================
> 
> This test was updated recently and it fails for both python3 and python2:
> 
> ==============================================================================
> --- /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py.out
> +++ /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py.err
> @@ -0,0 +1,7 @@
> +abort: no repository found in '/home/vladimir/tmp/mercurial/src/mercurial-5.4rc0' (.hg not found)!
> +Traceback (most recent call last):
> +  File "/home/vladimir/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py", line 76, in <module>
> +    "hg files --print0 \"%s\"" % fileset, shell=True, cwd=cwd,
> +  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output
> +    raise CalledProcessError(retcode, cmd, output=output)
> +subprocess.CalledProcessError: Command 'hg files --print0 "set:(**.py)"' returned non-zero exit status 255
>                                                                                                                                                                                                               
> ERROR: test-doctest.py output changed
> ==============================================================================
> 
> I'm not sure but seems the test assumes that it must be run within hg
> repository but such repository isn't created, hence the failure.
> 
> Third test: test-contrib-emacs.t
> 
> ==============================================================================
> --- /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-contrib-emacs.t
> +++ /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-contrib-emacs.t.err
> @@ -2,7 +2,7 @@
>     $ emacs -q -no-site-file -batch -l $TESTDIR/../contrib/hg-test-mode.el \
>     >  -f ert-run-tests-batch-and-exit
>     Running 1 tests (*) (glob)
> -     passed  1/1  hg-test-mode--compilation-mode-support
> +     passed  1/1  hg-test-mode--compilation-mode-support (0.019809 sec)
>                                                                                                                                                                                                               
> -  Ran 1 tests, 1 results as expected (*) (glob)
> +  Ran 1 tests, 1 results as expected, 0 unexpected (2020-04-23 06:27:46+0000, 0.019923 sec)
>                                                                                                                                                                                                               
>                                                                                                                                                                                                               
> ERROR: test-contrib-emacs.t output changed
> ==============================================================================
> 
> isn't related neither with mercurial or python3 but with Emacs. I'm using
> emacs compiled from git repository (28.0.50) and seems related with the Emacs
> routines and they output. Still the test might be updated to support upcoming
> versions of Emacs.
> 
> ---
> WBR, Vladimir Lomov
> 
> 
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

==============================================================================
--- /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-merge-tools.t                                                                                                                               
+++ /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-merge-tools.t.err                                                                                                                           
@@ -125,7 +125,7 @@                                                                                                                                                                                           
   $ hg up -qC 1                                                                                                                                                                                             
   $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2                                                                                                                                                
   merging f                                                                                                                                                                                                 
-  warning: conflicts while merging f! (edit, then use 'hg resolve --mark')                                                                                                                                  
+  merging f failed!                                                                                                                                                                                         
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved                                                                                                                                      
   use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon                                                                                                                         
   [1]                                                                                                                                                                                                       
@@ -139,7 +139,7 @@                                                                                                                                                                                           
   $ hg up -qC 1                                                                                                                                                                                             
   $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2                                                                                                                                                
   merging f                                                                                                                                                                                                 
-  warning: conflicts while merging f! (edit, then use 'hg resolve --mark')                                                                                                                                  
+  merging f failed!                                                                                                                                                                                         
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved                                                                                                                                      
   use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon                                                                                                                         
   [1]                                                                                                                                                                                                       
                                                                                                                                                                                                             
ERROR: test-merge-tools.t output changed
==============================================================================

If I understand code correctly, the "warning: conflicts while merging" message
is in 'mercurial/filemerge.py' in "annotation" (I not familiar enough with
python to name correctly shown part of the code):
==============================================================================
@internaltool(
    b'merge',
    fullmerge,
    _(
        b"warning: conflicts while merging %s! "
        b"(edit, then use 'hg resolve --mark')\n"
    ),
    precheck=_mergecheck,
)
==============================================================================

The "merging f failed" from the same file

==============================================================================
if tool in internals:
        func = internals[tool]
        mergetype = func.mergetype
        onfailure = func.onfailure
        precheck = func.precheck
        isexternal = False
    else:
        if wctx.isinmemory():
            func = _xmergeimm
        else:
            func = _xmerge
        mergetype = fullmerge
        onfailure = _(b"merging %s failed!\n")
        precheck = None
        isexternal = True
==============================================================================

function '_filemerge'. I don't known should '@internaltool' work with python3
or not but code suggests that test would fail even if there is no error due to
possible branching and _different_ message on failure.

Second test: test-doctest.py

==============================================================================
--- /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py.out                                                                                                                              
+++ /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py.err                                                                                                                              
@@ -0,0 +1,9 @@                                                                                                                                                                                               
+abort: no repository found in '/home/vladimir/tmp/mercurial/src/mercurial-5.4rc0' (.hg not found)!                                                                                                          
+Traceback (most recent call last):                                                                                                                                                                          
+  File "/home/vladimir/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py", line 75, in <module>                                                                                                      
+    files = subprocess.check_output(                                                                                                                                                                        
+  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output                                                                                                                                        
+    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,                                                                                                                                        
+  File "/usr/lib/python3.8/subprocess.py", line 512, in run                                                                                                                                                 
+    raise CalledProcessError(retcode, process.args,                                                                                                                                                         
+subprocess.CalledProcessError: Command 'hg files --print0 "set:(**.py)"' returned non-zero exit status 255.                                                                                                 
                                                                                                                                                                                                             
ERROR: test-doctest.py output changed
==============================================================================

This test was updated recently and it fails for both python3 and python2:

==============================================================================
--- /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py.out                                                                                                                              
+++ /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py.err                                                                                                                              
@@ -0,0 +1,7 @@                                                                                                                                                                                               
+abort: no repository found in '/home/vladimir/tmp/mercurial/src/mercurial-5.4rc0' (.hg not found)!                                                                                                          
+Traceback (most recent call last):                                                                                                                                                                          
+  File "/home/vladimir/tmp/mercurial/src/mercurial-5.4rc0/tests/test-doctest.py", line 76, in <module>                                                                                                      
+    "hg files --print0 \"%s\"" % fileset, shell=True, cwd=cwd,                                                                                                                                              
+  File "/usr/lib/python2.7/subprocess.py", line 223, in check_output                                                                                                                                        
+    raise CalledProcessError(retcode, cmd, output=output)                                                                                                                                                   
+subprocess.CalledProcessError: Command 'hg files --print0 "set:(**.py)"' returned non-zero exit status 255                                                                                                  
                                                                                                                                                                                                             
ERROR: test-doctest.py output changed 
==============================================================================

I'm not sure but seems the test assumes that it must be run within hg
repository but such repository isn't created, hence the failure. 

Third test: test-contrib-emacs.t

==============================================================================
--- /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-contrib-emacs.t                                                                                                                             
+++ /XXX/tmp/mercurial/src/mercurial-5.4rc0/tests/test-contrib-emacs.t.err                                                                                                                         
@@ -2,7 +2,7 @@                                                                                                                                                                                               
   $ emacs -q -no-site-file -batch -l $TESTDIR/../contrib/hg-test-mode.el \                                                                                                                                  
   >  -f ert-run-tests-batch-and-exit                                                                                                                                                                        
   Running 1 tests (*) (glob)                                                                                                                                                                                
-     passed  1/1  hg-test-mode--compilation-mode-support                                                                                                                                                    
+     passed  1/1  hg-test-mode--compilation-mode-support (0.019809 sec)                                                                                                                                     
                                                                                                                                                                                                             
-  Ran 1 tests, 1 results as expected (*) (glob)                                                                                                                                                             
+  Ran 1 tests, 1 results as expected, 0 unexpected (2020-04-23 06:27:46+0000, 0.019923 sec)