Package buildbot :: Package steps :: Module maxq
[frames] | no frames]

Source Code for Module buildbot.steps.maxq

 1  # This file is part of Buildbot.  Buildbot is free software: you can 
 2  # redistribute it and/or modify it under the terms of the GNU General Public 
 3  # License as published by the Free Software Foundation, version 2. 
 4  # 
 5  # This program is distributed in the hope that it will be useful, but WITHOUT 
 6  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
 7  # FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more 
 8  # details. 
 9  # 
10  # You should have received a copy of the GNU General Public License along with 
11  # this program; if not, write to the Free Software Foundation, Inc., 51 
12  # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 
13  # 
14  # Copyright Buildbot Team Members 
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
30 - def startStatus(self):
31 evt = Event("yellow", ['running', 'maxq', 'tests'], 32 files={'log': self.log}) 33 self.setCurrentActivity(evt)
34 35
36 - def finished(self, rc):
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
50 - def finishStatus(self, result):
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