Patchwork [V2] hook: filter out unstable output in tests

login
register
mail settings
Submitter Siddharth Agarwal
Date March 10, 2016, 6:13 p.m.
Message ID <bc4649e9bc48855a4644.1457633626@dev666.prn1.facebook.com>
Download mbox | patch
Permalink /patch/13743/
State Accepted
Headers show

Comments

Siddharth Agarwal - March 10, 2016, 6:13 p.m.
# HG changeset patch
# User Siddharth Agarwal <sid0@fb.com>
# Date 1457633543 28800
#      Thu Mar 10 10:12:23 2016 -0800
# Node ID bc4649e9bc48855a464414ee993fac96847c76b6
# Parent  1c658391b22fb4d98ccfb60c0e57315b55634117
# Available At http://42.netv6.net/sid0-wip/hg/
#              hg pull http://42.netv6.net/sid0-wip/hg/ -r bc4649e9bc48
hook: filter out unstable output in tests

This output is different between Python 2.6 and Python 2.7. It's also pretty
irrelevant, so just filter it out.
Pierre-Yves David - March 10, 2016, 7:16 p.m.
On 03/10/2016 06:13 PM, Siddharth Agarwal wrote:
> # HG changeset patch
> # User Siddharth Agarwal <sid0@fb.com>
> # Date 1457633543 28800
> #      Thu Mar 10 10:12:23 2016 -0800
> # Node ID bc4649e9bc48855a464414ee993fac96847c76b6
> # Parent  1c658391b22fb4d98ccfb60c0e57315b55634117
> # Available At http://42.netv6.net/sid0-wip/hg/
> #              hg pull http://42.netv6.net/sid0-wip/hg/ -r bc4649e9bc48
> hook: filter out unstable output in tests
>
> This output is different between Python 2.6 and Python 2.7. It's also pretty
> irrelevant, so just filter it out.

Still unsure why you dont just glob it, but not a big deal.

Pushed to the clowncopter.

Patch

diff --git a/tests/test-hook.t b/tests/test-hook.t
--- a/tests/test-hook.t
+++ b/tests/test-hook.t
@@ -530,13 +530,13 @@  test python hooks
   (run with --traceback for stack trace)
   [255]
 
-  $ hg pull ../a --traceback 2>&1 | egrep -v '^( +File|    [_a-zA-Z*(])'
+The second egrep is to filter out lines like '    ^', which are slightly
+different between Python 2.6 and Python 2.7.
+  $ hg pull ../a --traceback 2>&1 | egrep -v '^( +File|    [_a-zA-Z*(])' | egrep -v '^( )+(\^)?$'
   pulling from ../a
   searching for changes
   exception from first failed import attempt:
   Traceback (most recent call last):
-      
-      ^
   SyntaxError: invalid syntax
   exception from second failed import attempt:
   Traceback (most recent call last):