Patchwork [1,of,8] tests: add globs for Windows

login
register
mail settings
Submitter Matt Harbison
Date April 4, 2017, 12:23 a.m.
Message ID <op.yx491yv19lwrgf@envy>
Download mbox | patch
Permalink /patch/19946/
State Not Applicable
Headers show

Comments

Matt Harbison - April 4, 2017, 12:23 a.m.
On Mon, 03 Apr 2017 05:09:39 -0400, Kostia Balytskyi <ikostia@fb.com>  
wrote:

> What is stopping us from making run-tests match these things without  
> globs? Can we just always match smth1.replace('\', '//') vs  
> smth2.replace('\', '//') if ran on Windows?

I'm guessing it was just to be extra careful.

It might be a little more complicated though.  For example, without the  
glob, this diff occurs (note the double '\', and line ending difference.   
I'm not sure where the string compare is done vs adding the escaping '\'  
to the string.):


> I can send a patch if people think this is a good idea.

I'd be interested in trying that.  FWIW, in the past several years I've  
been playing whack-a-mole with this, the test runner never appended a  
(glob) inappropriately, so the logic must be in there already.

>
> -----Original Message-----
> From: Mercurial-devel [mailto:mercurial-devel-bounces@mercurial-scm.org]  
> On Behalf Of Matt Harbison
> Sent: Monday, 3 April, 2017 00:13
> To: mercurial-devel@mercurial-scm.org
> Subject: [PATCH 1 of 8] tests: add globs for Windows
>
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com> # Date 1491072519 14400
> #      Sat Apr 01 14:48:39 2017 -0400
> # Node ID 46f601b676cecfcc318f6852fe6ab6962703d2be
> # Parent  d1a1f21e86b2f976f5e968371f6cff145b98712a
> tests: add globs for Windows
>
> diff --git a/tests/test-bookmarks-pushpull.t  
> b/tests/test-bookmarks-pushpull.t
> --- a/tests/test-bookmarks-pushpull.t
> +++ b/tests/test-bookmarks-pushpull.t
> @@ -581,12 +581,12 @@
>  be exchanged)
>   $ hg -R repo1 incoming -B
> -  comparing with $TESTTMP/bmcomparison/source
> +  comparing with $TESTTMP/bmcomparison/source (glob)
>    searching for changed bookmarks
>    no changed bookmarks found
>    [1]
>    $ hg -R repo1 outgoing -B
> -  comparing with $TESTTMP/bmcomparison/source
> +  comparing with $TESTTMP/bmcomparison/source (glob)
>    searching for changed bookmarks
>    no changed bookmarks found
>    [1]
> diff --git a/tests/test-https.t b/tests/test-https.t
> --- a/tests/test-https.t
> +++ b/tests/test-https.t
> @@ -97,11 +97,12 @@
>    [255]
>  #endif
> -Specifying a per-host certificate file that doesn't exist will abort
> +Specifying a per-host certificate file that doesn't exist will abort.
> +The full C:/path/to/msysroot will print on Windows.
>   $ hg --config hostsecurity.localhost:verifycertsfile=/does/not/exist  
> clone  
> https://urldefense.proofpoint.com/v2/url?u=https-3A__localhost-3A-24HGPORT_&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=Pp-gQYFgs4tKlSFPF5kfCw&m=fkrqwBluYFCGdESYJYi8xhAZhP2kV1dBW30IT06QPIc&s=hiM2bF33c6k7YO7L2hPmdgCwx0RL-6mJn8xZTkJAdWU&e=
>    warning: connecting to localhost using legacy security technology  
> (TLS 1.0); see  
> https://urldefense.proofpoint.com/v2/url?u=https-3A__mercurial-2Dscm.org_wiki_SecureConnections&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=Pp-gQYFgs4tKlSFPF5kfCw&m=fkrqwBluYFCGdESYJYi8xhAZhP2kV1dBW30IT06QPIc&s=ovg3Pxm76NuFsItFtCq16Mp53e7D5LsyYF2r_yJcGQE&e=   
> for more info (?)
> -  abort: path specified by hostsecurity.localhost:verifycertsfile does  
> not exist: /does/not/exist
> +  abort: path specified by hostsecurity.localhost:verifycertsfile does
> + not exist: */does/not/exist (glob)
>    [255]
> A malformed per-host certificate file will raise an error diff --git  
> a/tests/test-largefiles-cache.t b/tests/test-largefiles-cache.t
> --- a/tests/test-largefiles-cache.t
> +++ b/tests/test-largefiles-cache.t
> @@ -223,7 +223,7 @@
>    $ hg push  
> https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A-24HGPORT1&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=Pp-gQYFgs4tKlSFPF5kfCw&m=fkrqwBluYFCGdESYJYi8xhAZhP2kV1dBW30IT06QPIc&s=ju5I1GImXMqktvYrqwpmCDXdgiKm0RuiHYcrjUY_frw&e=   
> -f --config files.usercache=nocache
>    pushing to  
> https://urldefense.proofpoint.com/v2/url?u=http-3A__localhost-3A-24HGPORT1_&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=Pp-gQYFgs4tKlSFPF5kfCw&m=fkrqwBluYFCGdESYJYi8xhAZhP2kV1dBW30IT06QPIc&s=4xcqfRg-K4IM5qtnN75gCmlA8bWdZY27a8gBV712RpY&e=
>    searching for changes
> -  abort: remotestore: could not open file  
> $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020:  
> HTTP Error 403: ssl required
> +  abort: remotestore: could not open file
> + $TESTTMP/src/.hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020:
> + HTTP Error 403: ssl required (glob)
>    [255]
>   $ rm .hg/largefiles/e2fb5f2139d086ded2cb600d5a91a196e76bf020
> diff --git a/tests/test-merge-criss-cross.t  
> b/tests/test-merge-criss-cross.t
> --- a/tests/test-merge-criss-cross.t
> +++ b/tests/test-merge-criss-cross.t
> @@ -116,11 +116,11 @@
>   $ f --dump --recurse *
>    d2: directory with 2 files
> -  d2/f3:
> +  d2/f3: (glob)
>    >>>
>    0 base
>    <<<
> -  d2/f4:
> +  d2/f4: (glob)
>    >>>
>    0 base
>    <<<
> @@ -222,11 +222,11 @@
>   $ f --dump --recurse *
>    d2: directory with 2 files
> -  d2/f3:
> +  d2/f3: (glob)
>    >>>
>    0 base
>    <<<
> -  d2/f4:
> +  d2/f4: (glob)
>    >>>
>    0 base
>    <<<
> @@ -308,11 +308,11 @@
>   $ f --dump --recurse *
>    d2: directory with 2 files
> -  d2/f3:
> +  d2/f3: (glob)
>    >>>
>    0 base
>    <<<
> -  d2/f4:
> +  d2/f4: (glob)
>    >>>
>    0 base
>    <<<
> diff --git a/tests/test-share.t b/tests/test-share.t
> --- a/tests/test-share.t
> +++ b/tests/test-share.t
> @@ -367,7 +367,7 @@
>    $ hg share -U thisdir/orig thisdir/abs
>    $ hg share -U --relative thisdir/abs thisdir/rel
>    $ cat thisdir/rel/.hg/sharedpath
> -  ../../orig/.hg (no-eol)
> +  ../../orig/.hg (no-eol) (glob)
>    $ grep shared thisdir/*/.hg/requires
>    thisdir/abs/.hg/requires:shared
>    thisdir/rel/.hg/requires:shared
> @@ -377,22 +377,22 @@
>   $ cd thisdir
>    $ hg -R rel root
> -  $TESTTMP/thisdir/rel
> +  $TESTTMP/thisdir/rel (glob)
>    $ cd ..
> now test that relative paths really are relative, survive across   
> renames and changes of PWD
>   $ hg -R thisdir/abs root
> -  $TESTTMP/thisdir/abs
> +  $TESTTMP/thisdir/abs (glob)
>    $ hg -R thisdir/rel root
> -  $TESTTMP/thisdir/rel
> +  $TESTTMP/thisdir/rel (glob)
>    $ mv thisdir thatdir
>    $ hg -R thatdir/abs root
> -  abort: .hg/sharedpath points to nonexistent directory  
> $TESTTMP/thisdir/orig/.hg!
> +  abort: .hg/sharedpath points to nonexistent directory
> + $TESTTMP/thisdir/orig/.hg! (glob)
>    [255]
>    $ hg -R thatdir/rel root
> -  $TESTTMP/thatdir/rel
> +  $TESTTMP/thatdir/rel (glob)
> test unshare relshared repo
> diff --git a/tests/test-status.t b/tests/test-status.t
> --- a/tests/test-status.t
> +++ b/tests/test-status.t
> @@ -121,11 +121,11 @@
>    ? ../b/in_b
>    ? ../in_root
>    $ HGPLAIN=1 hg status --cwd a
> -  ? a/1/in_a_1
> -  ? a/in_a
> -  ? b/1/in_b_1
> -  ? b/2/in_b_2
> -  ? b/in_b
> +  ? a/1/in_a_1 (glob)
> +  ? a/in_a (glob)
> +  ? b/1/in_b_1 (glob)
> +  ? b/2/in_b_2 (glob)
> +  ? b/in_b (glob)
>    ? in_root
>   $ cd ..
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.mercurial-2Dscm.org_mailman_listinfo_mercurial-2Ddevel&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=Pp-gQYFgs4tKlSFPF5kfCw&m=fkrqwBluYFCGdESYJYi8xhAZhP2kV1dBW30IT06QPIc&s=ofirdIh0lpG8lWQdq3UKHrFANUT0NzR6bFHu4Cqj0PI&e=

Patch

--- c:/Users/Matt/Projects/hg/tests/test-merge-criss-cross.t
+++ c:/Users/Matt/Projects/hg/tests/test-merge-criss-cross.t.err
@@ -116,11 +116,11 @@ 

    $ f --dump --recurse *
    d2: directory with 2 files
-  d2/f3:
-  >>>
-  0 base
-  <<<
-  d2/f4:
+  d2\\f3:\r (esc)
+  >>>
+  0 base
+  <<<
+  d2\\f4:\r (esc)
    >>>
    0 base
    <<<

It might also help for tests like this, where you can't put a glob IIRC:

diff --git a/tests/test-trusted.py.out b/tests/test-trusted.py.out
--- a/tests/test-trusted.py.out
+++ b/tests/test-trusted.py.out
@@ -184,7 +184,7 @@ 
  # suboptions, trusted and untrusted
  (None, []) ('main', [('one', 'one'), ('two', 'two')])
  # path, trusted and untrusted
-None .hg/monty/python
+None .hg\monty/python
  # bool, trusted and untrusted
  False True
  # int, trusted and untrusted