Patchwork [1,of,4] test-arbitraryfilectx: stabilize for Windows

login
register
mail settings
Submitter Matt Harbison
Date Oct. 29, 2017, 5:09 a.m.
Message ID <825986c7d37b50091097.1509253782@Envy>
Download mbox | patch
Permalink /patch/25304/
State Accepted
Headers show

Comments

Matt Harbison - Oct. 29, 2017, 5:09 a.m.
# HG changeset patch
# User Matt Harbison <matt_harbison@yahoo.com>
# Date 1508469408 14400
#      Thu Oct 19 23:16:48 2017 -0400
# Branch stable
# Node ID 825986c7d37b500910977fc9966619bd26dcaba3
# Parent  6e66033f91ccfb7666ec0a25d19954673269c61a
test-arbitraryfilectx: stabilize for Windows

Previously, the second last test (context.arbitraryfilectx(..)) returned True on
Windows.  I changed the repo setup sequence to import a patch, so that way the
repo would have a proper symlink.  That made the last test fail, since it is
comparing files in wdir(), one of which is not the expected symlink.

Apparently the (feature !) line matching doesn't work well with (no-eol), so I
had to conditionalize the test instead of the output.
Matt Harbison - Oct. 29, 2017, 5:28 a.m.
On Sun, 29 Oct 2017 01:09:42 -0400, Matt Harbison <mharbison72@gmail.com>  
wrote:

> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1508469408 14400
> #      Thu Oct 19 23:16:48 2017 -0400
> # Branch stable
> # Node ID 825986c7d37b500910977fc9966619bd26dcaba3
> # Parent  6e66033f91ccfb7666ec0a25d19954673269c61a
> test-arbitraryfilectx: stabilize for Windows

I've seen test stabilization patches both accepted and rejected during a  
freeze, but there are currently ~13 tests failing on Windows, with a ton  
of output.  Since there were (are?) actual bug lurking, it seems worth the  
minor changes.

The remaining failures are:

test-pathconflicts-merge.t
test-pathconflicts-basic.t
test-static-http.t

The first two have symlinks pretty tightly intertwined, and I don't see a  
clear way to conditionalize.  The last has a patch on the list that would  
fix the test.

I'm still no closer to figuring out why test-run-tests.t is failing under  
buildbot.  I tried splitting test-command-template.t to avoid the timeout  
a few weeks ago, and then started getting 'got 2 bytes, expected 4' type  
errors.  I haven't had time to go back and investigate yet.
Yuya Nishihara - Oct. 29, 2017, 7:29 a.m.
On Sun, 29 Oct 2017 01:09:42 -0400, Matt Harbison wrote:
> # HG changeset patch
> # User Matt Harbison <matt_harbison@yahoo.com>
> # Date 1508469408 14400
> #      Thu Oct 19 23:16:48 2017 -0400
> # Branch stable
> # Node ID 825986c7d37b500910977fc9966619bd26dcaba3
> # Parent  6e66033f91ccfb7666ec0a25d19954673269c61a
> test-arbitraryfilectx: stabilize for Windows

Queued the first three, thanks.

Patch

diff --git a/tests/test-arbitraryfilectx.t b/tests/test-arbitraryfilectx.t
--- a/tests/test-arbitraryfilectx.t
+++ b/tests/test-arbitraryfilectx.t
@@ -19,6 +19,7 @@ 
   $ mkdir case1
   $ cd case1
   $ hg init
+#if symlink
   $ printf "A" > real_A
   $ printf "foo" > A
   $ printf "foo" > B
@@ -29,6 +30,44 @@ 
   adding real_A
   adding sym_A
   $ hg commit -m "base"
+#else
+  $ hg import -q --bypass - <<EOF
+  > # HG changeset patch
+  > # User test
+  > # Date 0 0
+  > base
+  > 
+  > diff --git a/A b/A
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/A
+  > @@ -0,0 +1,1 @@
+  > +foo
+  > \ No newline at end of file
+  > diff --git a/B b/B
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/B
+  > @@ -0,0 +1,1 @@
+  > +foo
+  > \ No newline at end of file
+  > diff --git a/real_A b/real_A
+  > new file mode 100644
+  > --- /dev/null
+  > +++ b/real_A
+  > @@ -0,0 +1,1 @@
+  > +A
+  > \ No newline at end of file
+  > diff --git a/sym_A b/sym_A
+  > new file mode 120000
+  > --- /dev/null
+  > +++ b/sym_A
+  > @@ -0,0 +1,1 @@
+  > +A
+  > \ No newline at end of file
+  > EOF
+  $ hg up -q
+#endif
 
 These files are different and should return True (different):
 (Note that filecmp.cmp's return semantics are inverted from ours, so we invert
@@ -53,5 +92,10 @@ 
 
 A naive use of filecmp on those two would wrongly return True, since it follows
 the symlink to "A", which has different contents.
+#if symlink
   $ hg eval "not filecmp.cmp('real_A', 'sym_A')"
   True (no-eol)
+#else
+  $ hg eval "not filecmp.cmp('real_A', 'sym_A')"
+  False (no-eol)
+#endif