Patchwork run-tests: make _processoutput picky about optional globs

login
register
mail settings
Submitter timeless@mozdev.org
Date March 30, 2016, 9:15 a.m.
Message ID <d4280e641958915deba5.1459329331@waste.org>
Download mbox | patch
Permalink /patch/14177/
State Accepted
Headers show

Comments

timeless@mozdev.org - March 30, 2016, 9:15 a.m.
# HG changeset patch
# User timeless <timeless@mozdev.org>
# Date 1459329227 0
#      Wed Mar 30 09:13:47 2016 +0000
# Node ID d4280e641958915deba5d724faf8304925db69c6
# Parent  ff0d3b6b287f89594bd8d0308fe2810d2a18ea01
run-tests: make _processoutput picky about optional globs

1ad0ddf8cccc enabled lines that were not matched to be found later in cases of jitter.

Unfortunately, in this model an optional line would always jitter to the end when
it is not present. That is not ideal.

It would be possible to do better, by queuing all writes until the end in case
an optional line jitters, but for now, it is simpler to assume optional lines
have a fixed place in the stream.
Yuya Nishihara - March 31, 2016, 2:05 p.m.
On Wed, 30 Mar 2016 04:15:31 -0500, timeless wrote:
> # HG changeset patch
> # User timeless <timeless@mozdev.org>
> # Date 1459329227 0
> #      Wed Mar 30 09:13:47 2016 +0000
> # Node ID d4280e641958915deba5d724faf8304925db69c6
> # Parent  ff0d3b6b287f89594bd8d0308fe2810d2a18ea01
> run-tests: make _processoutput picky about optional globs

This looks better than before, queued, thanks!
timeless - April 5, 2016, 2:20 a.m.
I don't see it in the queue?

On Thu, Mar 31, 2016 at 10:05 AM, Yuya Nishihara <yuya@tcha.org> wrote:
> On Wed, 30 Mar 2016 04:15:31 -0500, timeless wrote:
>> # HG changeset patch
>> # User timeless <timeless@mozdev.org>
>> # Date 1459329227 0
>> #      Wed Mar 30 09:13:47 2016 +0000
>> # Node ID d4280e641958915deba5d724faf8304925db69c6
>> # Parent  ff0d3b6b287f89594bd8d0308fe2810d2a18ea01
>> run-tests: make _processoutput picky about optional globs
>
> This looks better than before, queued, thanks!
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
timeless - April 5, 2016, 2:21 a.m.
oops, sorry, I was looking at the wrong version *sigh*

On Mon, Apr 4, 2016 at 10:20 PM, timeless <timeless@gmail.com> wrote:
> I don't see it in the queue?
>
> On Thu, Mar 31, 2016 at 10:05 AM, Yuya Nishihara <yuya@tcha.org> wrote:
>> On Wed, 30 Mar 2016 04:15:31 -0500, timeless wrote:
>>> # HG changeset patch
>>> # User timeless <timeless@mozdev.org>
>>> # Date 1459329227 0
>>> #      Wed Mar 30 09:13:47 2016 +0000
>>> # Node ID d4280e641958915deba5d724faf8304925db69c6
>>> # Parent  ff0d3b6b287f89594bd8d0308fe2810d2a18ea01
>>> run-tests: make _processoutput picky about optional globs
>>
>> This looks better than before, queued, thanks!
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -1160,6 +1160,7 @@ 
                     els = expected[pos]
 
                 i = 0
+                optional = []
                 while i < len(els):
                     el = els[i]
 
@@ -1181,11 +1182,18 @@ 
                     if r:
                         els.pop(i)
                         break
+                    if el and el.endswith(b" (?)\n"):
+                        optional.append(i)
                     i += 1
 
                 if r:
                     if r == "retry":
                         continue
+                    # clean up any optional leftovers
+                    for i in optional:
+                        postout.append(b'  ' + els[i])
+                    for i in reversed(optional):
+                        del els[i]
                     postout.append(b'  ' + el)
                 else:
                     if self.NEEDESCAPE(lout):
diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t
--- a/tests/test-run-tests.t
+++ b/tests/test-run-tests.t
@@ -49,7 +49,7 @@ 
   >   $ echo babar
   >   babar
   >   $ echo xyzzy
-  >   never happens (?)
+  >   never*happens (glob) (?)
   >   xyzzy
   >   nor this (?)
   >   $ printf 'abc\ndef\nxyz\n'