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.builder import Event, SUCCESS, FAILURE
18
19 -class MaxQ(ShellCommand):
20 flunkOnFailure = True
21 name = "maxq"
22
23 - def __init__(self, testdir=None, **kwargs):
24 if not testdir:
25 raise TypeError("please pass testdir")
26 kwargs['command'] = 'run_maxq.py %s' % (testdir,)
27 ShellCommand.__init__(self, **kwargs)
28 self.addFactoryArguments(testdir=testdir)
29
31 evt = Event("yellow", ['running', 'maxq', 'tests'],
32 files={'log': self.log})
33 self.setCurrentActivity(evt)
34
35
37 self.failures = 0
38 if rc:
39 self.failures = 1
40 output = self.log.getAll()
41 self.failures += output.count('\nTEST FAILURE:')
42
43 result = (SUCCESS, ['maxq'])
44
45 if self.failures:
46 result = (FAILURE, [str(self.failures), 'maxq', 'failures'])
47
48 return self.stepComplete(result)
49
51 if self.failures:
52 text = ["maxq", "failed"]
53 else:
54 text = ['maxq', 'tests']
55 self.updateCurrentActivity(text=text)
56 self.finishStatusSummary()
57 self.finishCurrentActivity()
58