def stepDone(self, results, step): """This method is called when the BuildStep completes. It is passed a status object from the BuildStep and is responsible for merging the Step's results into those of the overall Build.""" terminate = False text = None if isinstance(results, tuple): results, text = results assert isinstance(results, type(SUCCESS)), "got %r" % (results,) summary = yield step.getBuildResultSummary() if 'build' in summary: text = [summary['build']] log.msg(" step '%s' complete: %s (%s)" % (step.name, statusToString(results), text)) if text: self.text.extend(text) self.master.data.updates.setBuildStateString(self.buildid, bytes2unicode(" ".join(self.text))) self.results, terminate = computeResultAndTermination(step, results, self.results) if not self.conn: # force the results to retry if the connection was lost self.results = RETRY terminate = True defer.returnValue(terminate)
def do_test_carc(self, result, previousResult, newResult, terminate, haltOnFailure=[True, False], flunkOnWarnings=[ True, False], flunkOnFailure=[True, False], warnOnWarnings=[ True, False], warnOnFailure=[True, False]): for hof in haltOnFailure: for fow in flunkOnWarnings: for fof in flunkOnFailure: for wow in warnOnWarnings: for wof in warnOnFailure: self.haltOnFailure = hof self.flunkOnWarnings = fow self.flunkOnFailure = fof self.warnOnWarnings = wow self.warnOnFailure = wof nr, term = results.computeResultAndTermination( self, result, previousResult) log.msg("res=%r prevRes=%r hof=%r fow=%r fof=%r " "wow=%r wof=%r => %r %r" % (results.Results[result], results.Results[previousResult], hof, fow, fof, wow, wof, results.Results[nr], term)) self.assertEqual((nr, term), (newResult, terminate), "see test.log for details")
def runShellSequence(self, commands): terminate = False if commands is None: log.msg("After rendering, ShellSequence `commands` is None") defer.returnValue(results.EXCEPTION) overall_result = results.SUCCESS for arg in commands: if not isinstance(arg, ShellArg): log.msg("After rendering, ShellSequence `commands` list " "contains something that is not a ShellArg") defer.returnValue(results.EXCEPTION) try: arg.validateAttributes() except config.ConfigErrors as e: log.msg("After rendering, ShellSequence `commands` is " "invalid: %s" % (e, )) defer.returnValue(results.EXCEPTION) # handle the command from the arg command = arg.command if not self.shouldRunTheCommand(command): continue # keep the command around so we can describe it self.last_command = command cmd = yield self.makeRemoteShellCommand(command=command, stdioLogName=arg.logfile) yield self.runCommand(cmd) overall_result, terminate = results.computeResultAndTermination( arg, cmd.results(), overall_result) if terminate: break defer.returnValue(overall_result)
def runShellSequence(self, commands): terminate = False if commands is None: log.msg("After rendering, ShellSequence `commands` is None") defer.returnValue(results.EXCEPTION) overall_result = results.SUCCESS for arg in commands: if not isinstance(arg, ShellArg): log.msg("After rendering, ShellSequence `commands` list " "contains something that is not a ShellArg") defer.returnValue(results.EXCEPTION) try: arg.validateAttributes() except config.ConfigErrors as e: log.msg("After rendering, ShellSequence `commands` is " "invalid: %s" % (e,)) defer.returnValue(results.EXCEPTION) # handle the command from the arg command = arg.command if not self.shouldRunTheCommand(command): continue # keep the command around so we can describe it self.last_command = command cmd = yield self.makeRemoteShellCommand(command=command, stdioLogName=arg.logfile) yield self.runCommand(cmd) overall_result, terminate = results.computeResultAndTermination( arg, cmd.results(), overall_result) if terminate: break defer.returnValue(overall_result)
def run(self): terminate = False overall_result = util.SUCCESS for patch in self.patches: patch = os.path.join(self.base_dir, patch) # setup structures for reading the file try: with open(patch, 'rb') as fp: patch_data = fp.read() except IOError: # if file does not exist, bail out with an error yield self.addCompleteLog('stderr', 'File %r not available at master' % patch) return util.FAILURE cmd = yield self.makeRemoteShellCommand(command=self.command, initialStdin=patch_data) yield self.runCommand(cmd) overall_result, terminate = results.computeResultAndTermination( self, cmd.results(), overall_result) if terminate: break if overall_result == util.SUCCESS: self.descriptionDone = ["patched"] return overall_result
def stepDone(self, results, step): """This method is called when the BuildStep completes. It is passed a status object from the BuildStep and is responsible for merging the Step's results into those of the overall Build.""" terminate = False text = None if isinstance(results, tuple): results, text = results assert isinstance(results, type(SUCCESS)), "got %r" % (results,) log.msg(" step '%s' complete: %s" % (step.name, Results[results])) if text: self.text.extend(text) self.results, terminate = computeResultAndTermination(step, results, self.results) if not self.conn: terminate = True return terminate
def stepDone(self, results, step): """This method is called when the BuildStep completes. It is passed a status object from the BuildStep and is responsible for merging the Step's results into those of the overall Build.""" terminate = False text = None if isinstance(results, tuple): results, text = results assert isinstance(results, type(SUCCESS)), "got %r" % (results, ) log.msg(" step '%s' complete: %s" % (step.name, Results[results])) if text: self.text.extend(text) self.results, terminate = computeResultAndTermination( step, results, self.results) if not self.conn: terminate = True return terminate
def do_test_carc(self, result, previousResult, newResult, terminate, haltOnFailure=None, flunkOnWarnings=None, flunkOnFailure=None, warnOnWarnings=None, warnOnFailure=None): if haltOnFailure is None: haltOnFailure = [True, False] if flunkOnWarnings is None: flunkOnWarnings = [True, False] if flunkOnFailure is None: flunkOnFailure = [True, False] if warnOnWarnings is None: warnOnWarnings = [True, False] if warnOnFailure is None: warnOnFailure = [True, False] for hof in haltOnFailure: for fow in flunkOnWarnings: for fof in flunkOnFailure: for wow in warnOnWarnings: for wof in warnOnFailure: self.haltOnFailure = hof self.flunkOnWarnings = fow self.flunkOnFailure = fof self.warnOnWarnings = wow self.warnOnFailure = wof nr, term = results.computeResultAndTermination( self, result, previousResult) log.msg( f"res={repr(results.Results[result])} " f"prevRes={repr(results.Results[previousResult])} " f"hof={repr(hof)} fow={repr(fow)} fof={repr(fof)} " f"wow={repr(wow)} wof={repr(wof)} => " f"{repr(results.Results[nr])} {repr(term)}") self.assertEqual((nr, term), (newResult, terminate), "see test.log for details")