1   
 2   
 3   
 4   
 5   
 6   
 7   
 8   
 9   
10   
11   
12   
13   
14   
15   
16  from buildbot.steps.shell import ShellCommand 
17  from buildbot.status.event import Event 
18  from buildbot.status.results import SUCCESS, FAILURE 
19   
20 -class MaxQ(ShellCommand): 
 21      flunkOnFailure = True 
22      name = "maxq" 
23   
24 -    def __init__(self, testdir=None, **kwargs): 
 25          if not testdir: 
26              raise TypeError("please pass testdir") 
27          kwargs['command'] = 'run_maxq.py %s' % (testdir,) 
28          ShellCommand.__init__(self, **kwargs) 
29          self.addFactoryArguments(testdir=testdir) 
 30   
32          evt = Event("yellow", ['running', 'maxq', 'tests'], 
33                      files={'log': self.log}) 
34          self.setCurrentActivity(evt) 
 35   
36   
38          self.failures = 0 
39          if rc: 
40              self.failures = 1 
41          output = self.log.getAll() 
42          self.failures += output.count('\nTEST FAILURE:') 
43   
44          result = (SUCCESS, ['maxq']) 
45   
46          if self.failures: 
47              result = (FAILURE, [str(self.failures), 'maxq', 'failures']) 
48   
49          return self.stepComplete(result) 
 50   
52          if self.failures: 
53              text = ["maxq", "failed"] 
54          else: 
55              text = ['maxq', 'tests'] 
56          self.updateCurrentActivity(text=text) 
57          self.finishStatusSummary() 
58          self.finishCurrentActivity() 
  59