Exemplo n.º 1
0
 def handle_script_error(cls, tool, state, script_error):
     is_svn_apply = script_error.command_name() == "svn-apply"
     status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply)
     if is_svn_apply:
         QueueEngine.exit_after_handled_error(script_error)
     message = "Attachment %s did not pass %s:\n\n%s\n\nIf any of these errors are false positives, please file a bug against check-webkit-style." % (state["patch"].id(), cls.name, script_error.message_with_output(output_limit=3*1024))
     tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers)
     exit(1)
Exemplo n.º 2
0
 def handle_script_error(cls, tool, state, script_error):
     is_svn_apply = script_error.command_name() == "svn-apply"
     status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply)
     if is_svn_apply:
         QueueEngine.exit_after_handled_error(script_error)
     message = "Attachment %s did not pass %s:\n\n%s\n\nIf any of these errors are false positives, please file a bug against check-webkit-style." % (state["patch"].id(), cls.name, script_error.message_with_output(output_limit=3*1024))
     tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers)
     exit(1)
Exemplo n.º 3
0
 def handle_script_error(cls, tool, state, script_error):
     is_svn_apply = script_error.command_name() == "svn-apply"
     status_id = cls._update_status_for_script_error(tool, state, script_error, is_error=is_svn_apply)
     if is_svn_apply:
         QueueEngine.exit_after_handled_error(script_error)
     results_link = tool.status_server.results_url_for_status(status_id)
     message = "Attachment %s did not build on %s:\nBuild output: %s" % (state["patch"].id(), cls.port_name, results_link)
     tool.bugs.post_comment_to_bug(state["patch"].bug_id(), message, cc=cls.watchers)
     exit(1)
Exemplo n.º 4
0
 def run_and_handle_errors(self, tool, options, state=None):
     if not state:
         state = {}
     try:
         self._run(tool, options, state)
     except CheckoutNeedsUpdate, e:
         log("Commit failed because the checkout is out of date.  Please update and try again.")
         log("You can pass --no-build to skip building/testing after update if you believe the new commits did not affect the results.")
         QueueEngine.exit_after_handled_error(e)
Exemplo n.º 5
0
 def run_and_handle_errors(self, tool, options, state=None):
     if not state:
         state = {}
     try:
         self._run(tool, options, state)
     except CheckoutNeedsUpdate, e:
         log("Commit failed because the checkout is out of date.  Please update and try again.")
         log("You can pass --no-build to skip building/testing after update if you believe the new commits did not affect the results.")
         QueueEngine.exit_after_handled_error(e)
Exemplo n.º 6
0
class StepSequence(object):
    def __init__(self, steps):
        self._steps = steps or []

    def options(self):
        collected_options = [
            steps.Options.parent_command,
            steps.Options.quiet,
        ]
        for step in self._steps:
            collected_options = collected_options + step.options()
        # Remove duplicates.
        collected_options = sorted(set(collected_options))
        return collected_options

    def _run(self, tool, options, state):
        for step in self._steps:
            step(tool, options).run(state)

    def run_and_handle_errors(self, tool, options, state=None):
        if not state:
            state = {}
        try:
            self._run(tool, options, state)
        except CheckoutNeedsUpdate, e:
            log("Commit failed because the checkout is out of date.  Please update and try again.")
            log("You can pass --no-build to skip building/testing after update if you believe the new commits did not affect the results.")
            QueueEngine.exit_after_handled_error(e)
        except ScriptError, e:
            if not options.quiet:
                log(e.message_with_output())
            if options.parent_command:
                command = tool.command_by_name(options.parent_command)
                command.handle_script_error(tool, state, e)
            QueueEngine.exit_after_handled_error(e)