我想针对正在运行的服务器运行集成测试,并检索服务器输出以便稍后检查。
答案 0 :(得分:0)
这是一种使用本地奴隶的廉价方法(否则你可能需要一个FileUpload额外步骤)
class StopServer(ShellCommand):
def _init_(self):
ShellCommand.__init__(self, command=['pkill', '-f', 'my-server-name'],
workdir='build/python',
description='Stopping test server')
def createSummary(self, log):
buildername = self.getProperty("buildername")
f = '/home/buildbot/slave/%s/build/python/nohup.out' % buildername
output = open(f, "r").read()
self.addCompleteLog('server output', output)
class StartServer(ShellCommand):
def _init_(self):
ShellCommand.__init__(self, command=['./start-test-server.sh'],
workdir='build/python', haltOnFailure=True,
description='Starting test server')
shell脚本只是一个带有stderr和stdout重定向的nohup