Bug 37487 - Make new-run-webkit-test PrettyPatch failure reporting more awesome
Summary: Make new-run-webkit-test PrettyPatch failure reporting more awesome
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-12 21:29 PDT by Eric Seidel (no email)
Modified: 2010-04-12 22:07 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.94 KB, patch)
2010-04-12 21:32 PDT, Eric Seidel (no email)
abarth: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2010-04-12 21:29:50 PDT
Make new-run-webkit-test PrettyPatch failure reporting more awesome
Comment 1 Eric Seidel (no email) 2010-04-12 21:32:23 PDT
Created attachment 53222 [details]
Patch
Comment 2 Adam Barth 2010-04-12 21:36:34 PDT
Comment on attachment 53222 [details]
Patch

ok.  missing a space
Comment 3 Eric Seidel (no email) 2010-04-12 21:38:45 PDT
Committed r57500: <http://trac.webkit.org/changeset/57500>
Comment 4 Dirk Pranke 2010-04-12 21:42:58 PDT
Comment on attachment 53222 [details]
Patch

>          command = ["ruby", "-I", pretty_patch_path, prettify_path, diff_path]
>          try:
>              return self._executive.run_command(command)
>          except OSError, e:
> -            # If they system is missing ruby just log the error, and stop trying.
> +            # If the system is missing ruby log the error and stop trying.
>              _pretty_patch_available = False
> -            return "Failed to run PrettyPatch: %s" % e
> -        except Executive.ScriptError, e:
> -            # If they system is missing ruby just log the error, and stop trying.
> +            _log.error("Failed to run PrettyPatch (%s): %s" % (command, e))
> +            return self._pretty_patch_error_html
> +        except ScriptError, e:
> +            # If ruby failed to run for some reason, log the command output and stop trying.
>              _pretty_patch_available = False
> -            return "Failed to run PrettyPatch: %s" % e
> +            _log.error("Failed to run PrettyPatch (%s):\n%s" % (command, e.message_with_output()))
> +            return self._pretty_patch_error_html
>

Why does this routine have to catch either a ScriptError or an OSError? It seems like maybe the run_command() semantics aren't clear?
Comment 5 Eric Seidel (no email) 2010-04-12 21:46:28 PDT
They mean different things.  OSError means you're missing the file you tried to run.  ScriptError means it returned non-zero.