Bug 37487

Summary: Make new-run-webkit-test PrettyPatch failure reporting more awesome
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, dbates, dpranke, dumi, tony
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Attachments:
Description Flags
Patch abarth: review+

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.