1 from buildbot
.steps
.shell
import ShellCommand
2 from buildbot
.status
import event
, builder
4 class MaxQ(ShellCommand
):
8 def __init__(self
, testdir
=None, **kwargs
):
10 raise TypeError("please pass testdir")
11 command
= 'run_maxq.py %s' % (testdir
,)
12 ShellCommand
.__init
__(self
, command
=command
, **kwargs
)
14 def startStatus(self
):
15 evt
= event
.Event("yellow", ['running', 'maxq', 'tests'],
16 files
={'log': self
.log
})
17 self
.setCurrentActivity(evt
)
20 def finished(self
, rc
):
24 output
= self
.log
.getAll()
25 self
.failures
+= output
.count('\nTEST FAILURE:')
27 result
= (builder
.SUCCESS
, ['maxq'])
30 result
= (builder
.FAILURE
,
31 [str(self
.failures
), 'maxq', 'failures'])
33 return self
.stepComplete(result
)
35 def finishStatus(self
, result
):
38 text
= ["maxq", "failed"]
41 text
= ['maxq', 'tests']
42 self
.updateCurrentActivity(color
=color
, text
=text
)
43 self
.finishStatusSummary()
44 self
.finishCurrentActivity()