Ticket #414: alwaysrun.patch

File alwaysrun.patch, 2.5 KB (added by catlee, 4 years ago)

implement alwaysRun flag

  • process/base.py

    RCS file: /cvsroot/mozilla/tools/buildbot/buildbot/process/base.py,v
    retrieving revision 1.2
    diff -u -r1.2 base.py
     
    182182        self.currentStep = None 
    183183        self.slaveEnvironment = {} 
    184184 
     185        self.terminate = False 
     186 
    185187    def setBuilder(self, builder): 
    186188        """ 
    187189        Set the given builder as our builder. 
     
    450452        is complete.""" 
    451453        if not self.steps: 
    452454            return None 
    453         return self.steps.pop(0) 
     455        if self.terminate: 
     456            while True: 
     457                s = self.steps.pop(0) 
     458                if s.alwaysRun: 
     459                    return s 
     460                if not self.steps: 
     461                    return None 
     462        else: 
     463            return self.steps.pop(0) 
    454464 
    455465    def startNextStep(self): 
    456466        try: 
     
    470480            return # build was interrupted, don't keep building 
    471481        terminate = self.stepDone(results, step) # interpret/merge results 
    472482        if terminate: 
    473             return self.allStepsDone() 
    474         self.startNextStep() 
     483            self.terminate = True 
     484        return self.startNextStep() 
    475485 
    476486    def stepDone(self, result, step): 
    477487        """This method is called when the BuildStep completes. It is passed a 
  • process/buildstep.py

    RCS file: /cvsroot/mozilla/tools/buildbot/buildbot/process/buildstep.py,v
    retrieving revision 1.1.1.4
    diff -u -r1.1.1.4 buildstep.py
     
    544544    # immediately, the others will be taken into consideration when 
    545545    # determining the overall build status. 
    546546    # 
     547    # steps that are makred as alwaysRun will be run regardless of the outcome 
     548    # of previous steps (especially steps with haltOnFailure=True) 
    547549    haltOnFailure = False 
    548550    flunkOnWarnings = False 
    549551    flunkOnFailure = False 
    550552    warnOnWarnings = False 
    551553    warnOnFailure = False 
     554    alwaysRun = False 
    552555 
    553556    # 'parms' holds a list of all the parameters we care about, to allow 
    554557    # users to instantiate a subclass of BuildStep with a mixture of 
     
    563566             'flunkOnFailure', 
    564567             'warnOnWarnings', 
    565568             'warnOnFailure', 
     569             'alwaysRun', 
    566570             'progressMetrics', 
    567571             ] 
    568572