Patchwork run-tests: sort missing files first instead of raising an error

login
register
mail settings
Submitter Simon Heimberg
Date June 11, 2013, 10:09 p.m.
Message ID <3a43e3a9de8e3002b9ce.1370988562@lapsi.heimberg.home>
Download mbox | patch
Permalink /patch/1720/
State Accepted
Commit 401b3ad26e66f6b69937e1aa808da07065c408a6
Headers show

Comments

Simon Heimberg - June 11, 2013, 10:09 p.m.
# HG changeset patch
# User simon@laptop-tosh
# Date 1370986788 -7200
# Node ID 3a43e3a9de8e3002b9ce1ef97398054b7c65e356
# Parent  893563fd066688b54c9b35dcd59ddce978ecf44e
run-tests: sort missing files first instead of raising an error

sort first for early telling typos in test names
Matt Mackall - June 12, 2013, 9:07 p.m.
On Wed, 2013-06-12 at 00:09 +0200, Simon Heimberg wrote:
> # HG changeset patch
> # User simon@laptop-tosh
> # Date 1370986788 -7200
> # Node ID 3a43e3a9de8e3002b9ce1ef97398054b7c65e356
> # Parent  893563fd066688b54c9b35dcd59ddce978ecf44e
> run-tests: sort missing files first instead of raising an error

Queued for default, thanks.

Patch

diff -r 893563fd0666 -r 3a43e3a9de8e tests/run-tests.py
--- a/tests/run-tests.py	Die Jun 11 23:36:46 2013 +0200
+++ b/tests/run-tests.py	Die Jun 11 23:39:48 2013 +0200
@@ -1156,7 +1156,12 @@ 
         slow = 'svn gendoc check-code-hg'.split()
         def sortkey(f):
             # run largest tests first, as they tend to take the longest
-            val = -os.stat(f).st_size
+            try:
+                val = -os.stat(f).st_size
+            except OSError, e:
+                if e.errno != errno.ENOENT:
+                    raise
+                return -1e9 # file does not exist, tell early
             for kw in slow:
                 if kw in f:
                     val *= 10