Patchwork run-tests: report tests as failed when run-test raises an error

login
register
mail settings
Submitter Simon Heimberg
Date Jan. 16, 2014, 10:30 a.m.
Message ID <076bb545349bb0ebc8e6.1389868245@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/3347/
State Superseded
Commit 3cd441353d6ba351b5e9431048726f477e371cfc
Headers show

Comments

Simon Heimberg - Jan. 16, 2014, 10:30 a.m.
# HG changeset patch
# User Simon Heimberg <simohe@besonet.ch>
# Date 1389868135 -3600
# Node ID 076bb545349bb0ebc8e6ab6def2f4f4b0c905667
# Parent  34a816e97e692cc547dde29fa4d95dcd7e918b3d
run-tests: report tests as failed when run-test raises an error

Before no message was returned to the main thread. No result was registered
and no new thread was started.
This does not happen when running normal. But when fiddling around with
the test infrastructure, this helps a lot.
Augie Fackler - Jan. 16, 2014, 2:35 p.m.
On Thu, Jan 16, 2014 at 11:30:45AM +0100, Simon Heimberg wrote:
> # HG changeset patch
> # User Simon Heimberg <simohe@besonet.ch>
> # Date 1389868135 -3600
> # Node ID 076bb545349bb0ebc8e6ab6def2f4f4b0c905667
> # Parent  34a816e97e692cc547dde29fa4d95dcd7e918b3d
> run-tests: report tests as failed when run-test raises an error

Makes sense. Queued.

>
> Before no message was returned to the main thread. No result was registered
> and no new thread was started.
> This does not happen when running normal. But when fiddling around with
> the test infrastructure, this helps a lot.
>
> diff -r 34a816e97e69 -r 076bb545349b tests/run-tests.py
> --- a/tests/run-tests.py	Don Jan 16 11:26:54 2014 +0100
> +++ b/tests/run-tests.py	Don Jan 16 11:28:55 2014 +0100
> @@ -1092,6 +1092,9 @@
>              done.put(runone(options, test, count))
>          except KeyboardInterrupt:
>              pass
> +        except: # re-raises
> +            done.put('!', test, 'run-test raised an error, see traceback')
> +            raise
>
>      try:
>          while tests or running:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Simon Heimberg - Jan. 16, 2014, 5:47 p.m.
Wait please.  It is buggy, see below. I will resend soon.

On 16.01.2014 15:35, Augie Fackler wrote:
> On Thu, Jan 16, 2014 at 11:30:45AM +0100, Simon Heimberg wrote:
>> # HG changeset patch
>> # User Simon Heimberg <simohe@besonet.ch>
>> # Date 1389868135 -3600
>> # Node ID 076bb545349bb0ebc8e6ab6def2f4f4b0c905667
>> # Parent  34a816e97e692cc547dde29fa4d95dcd7e918b3d
>> run-tests: report tests as failed when run-test raises an error
> Makes sense. Queued.
>
>> Before no message was returned to the main thread. No result was registered
>> and no new thread was started.
>> This does not happen when running normal. But when fiddling around with
>> the test infrastructure, this helps a lot.
>>
>> diff -r 34a816e97e69 -r 076bb545349b tests/run-tests.py
>> --- a/tests/run-tests.py	Don Jan 16 11:26:54 2014 +0100
>> +++ b/tests/run-tests.py	Don Jan 16 11:28:55 2014 +0100
>> @@ -1092,6 +1092,9 @@
>>               done.put(runone(options, test, count))
>>           except KeyboardInterrupt:
>>               pass
>> +        except: # re-raises
>> +            done.put('!', test, 'run-test raised an error, see traceback')
There is missing () around the tupple, it is passed as argument for put 
instead.  This results in an error when unpacking.
>> +            raise
>>
>>       try:
>>           while tests or running:
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@selenic.com
>> http://selenic.com/mailman/listinfo/mercurial-devel

Patch

diff -r 34a816e97e69 -r 076bb545349b tests/run-tests.py
--- a/tests/run-tests.py	Don Jan 16 11:26:54 2014 +0100
+++ b/tests/run-tests.py	Don Jan 16 11:28:55 2014 +0100
@@ -1092,6 +1092,9 @@ 
             done.put(runone(options, test, count))
         except KeyboardInterrupt:
             pass
+        except: # re-raises
+            done.put('!', test, 'run-test raised an error, see traceback')
+            raise
 
     try:
         while tests or running: