예제 #1
0
	def setUpExecution(self, client, name, ok=True, running=False) :
		s = Logger("fixture")
		e = ArgPrepender(s, "myproject", client, name)
		timestamp = "{0:%Y-%m-%d %H:%M:%S}".format(
			datetime.datetime.strptime(name, "%Y%m%d-%H%M%S"))
		e.executionStarts(
			timestamp= timestamp,
			changelog=[])
		e.taskStarts(1,"First task")
		if running : return
		e.taskEnds(1,ok)
		s.now = datetime.datetime(2013,4,5,6,7,8)
		e.executionEnds(ok)
예제 #2
0
	def setUpExecution(self, logger, name, running=False, ok=True) :
		e = ArgPrepender(logger, "myproject", "myclient", name)
		timestamp = "{0:%Y-%m-%d %H:%M:%S}".format(
			datetime.datetime.strptime(name, "%Y%m%d-%H%M%S"))
		e.executionStarts(
			timestamp= timestamp,
			changelog=[])
		e.taskStarts(1, "First task")
		e.commandStarts(1,1, "command line")
		e.commandEnds(1,1, output="output", ok=ok, info=None, stats={})
		if running : return
		e.taskEnds(1,ok)
		e.executionEnds(ok)
예제 #3
0
	def executionFixture(self, running = False) :
		project, client, execution = "myproject", "myclient", "20130301-232425"
		s = Logger("fixture")
		s.createServer()
		s.createProject(project)
		s.createClient(project, client)
		# force an idle time
		s.now=datetime.datetime(2013,4,5,6,7,8)
		s.clientIdle(project,client, 0)

		e = ArgPrepender(s, project, client, execution)
		e.executionStarts(
			timestamp="2013-03-01 23:24:25",
			changelog=[])
		e.taskStarts(1, "First task")
		e.commandStarts(1,1, "command line")
		if running : return e.execution()
		e.commandEnds(1,1, output="output", ok=True, info=None, stats={})
		e.taskEnds(1,True)
		e.executionEnds(True)
		return e.execution()
예제 #4
0
	def commandFixture(self, line,
			running = False,
			ok = None,
			output=None,
			info=None,
			stats = {}
			) :
		project, client, execution = "myproject", "myclient", "20130301-232425"
		s = Logger("fixture")
		s.createServer()
		s.createProject(project)
		s.createClient(project, client)
		e = ArgPrepender(s, project, client, execution)
		e.executionStarts(
			timestamp="2013-03-01 23:24:25",
			changelog=[])
		e.taskStarts(1, "First task")
		e.commandStarts(1,1, line)
		if running : return e.execution().tasks[0].commands[0]
		e.commandEnds(1,1, output=output, ok=ok, info=info, stats=stats)
		e.taskEnds(1,True)
		e.executionEnds(True)
		return e.execution().tasks[0].commands[0]
예제 #5
0
	def taskFixture(self, description,
			commands = 0,
			id = 1,
			running = False,
			ok = None,
			info=None,
			stats = {}
			) :
		project, client, execution = "myproject", "myclient", "20130301-232425"
		s = Logger("fixture")
		e = ArgPrepender(s, project, client, execution)
		e.executionStarts(
			timestamp="2013-03-01 23:24:25",
			changelog=[])
		e.taskStarts(id, description)
		for i in xrange(commands) :
			output="output for command {}".format(i)
			ok = True
			e.commandStarts(id,i+1, "command line")
			if running : return e.execution().tasks[0]
			e.commandEnds(id,i+1, output=output, ok=ok, info=info, stats=stats)
		e.taskEnds(id,True)
		e.executionEnds(True)
		return e.execution().tasks[id-1]