Implement initial_delay

This commit is contained in:
Sergio Durigan Junior 2015-07-30 17:30:44 -04:00
parent f09af5c266
commit f10d5d0e54
2 changed files with 22 additions and 2 deletions

View file

@ -98,31 +98,37 @@
{ "name" : "Debian-x86_64-m64", { "name" : "Debian-x86_64-m64",
"type" : "Plain_c64t64", "type" : "Plain_c64t64",
"builddir" : "debian-x86-64", "builddir" : "debian-x86-64",
"initial_delay" : "600",
"slavenames" : [ "wildebeest-debian-wheezy-x86_64" ] }, "slavenames" : [ "wildebeest-debian-wheezy-x86_64" ] },
{ "name" : "Debian-x86_64-native-gdbserver-m64", { "name" : "Debian-x86_64-native-gdbserver-m64",
"type" : "NativeGDBServer_c64t64", "type" : "NativeGDBServer_c64t64",
"builddir" : "debian-x86-64-native-gdbserver", "builddir" : "debian-x86-64-native-gdbserver",
"initial_delay" : "600",
"slavenames" : [ "wildebeest-debian-wheezy-x86_64" ] }, "slavenames" : [ "wildebeest-debian-wheezy-x86_64" ] },
{ "name" : "Debian-x86_64-native-extended-gdbserver-m64", { "name" : "Debian-x86_64-native-extended-gdbserver-m64",
"type" : "NativeExtendedGDBServer_c64t64", "type" : "NativeExtendedGDBServer_c64t64",
"builddir" : "debian-x86-64-native-extended-gdbserver", "builddir" : "debian-x86-64-native-extended-gdbserver",
"initial_delay" : "600",
"slavenames" : [ "wildebeest-debian-wheezy-x86_64" ] }, "slavenames" : [ "wildebeest-debian-wheezy-x86_64" ] },
{ "name" : "Debian-i686-native-gdbserver", { "name" : "Debian-i686-native-gdbserver",
"type" : "NativeGDBServer_c32t32", "type" : "NativeGDBServer_c32t32",
"builddir" : "debian-i686-native-gdbserver", "builddir" : "debian-i686-native-gdbserver",
"initial_delay" : "600",
"slavenames" : [ "wildebeest-debian-wheezy-i686" ] }, "slavenames" : [ "wildebeest-debian-wheezy-i686" ] },
{ "name" : "Debian-i686-native-extended-gdbserver", { "name" : "Debian-i686-native-extended-gdbserver",
"type" : "NativeExtendedGDBServer_c32t32", "type" : "NativeExtendedGDBServer_c32t32",
"builddir" : "debian-i686-native-extended-gdbserver", "builddir" : "debian-i686-native-extended-gdbserver",
"initial_delay" : "600",
"slavenames" : [ "wildebeest-debian-wheezy-i686" ] }, "slavenames" : [ "wildebeest-debian-wheezy-i686" ] },
{ "name" : "Debian-i686", { "name" : "Debian-i686",
"type" : "Plain_c32t32", "type" : "Plain_c32t32",
"builddir" : "debian-i686", "builddir" : "debian-i686",
"initial_delay" : "600",
"slavenames" : [ "wildebeest-debian-wheezy-i686" ] }, "slavenames" : [ "wildebeest-debian-wheezy-i686" ] },

View file

@ -612,11 +612,17 @@ The parameters of the class are:
# (i.e., do not use '--with-separate-debug-dir') # (i.e., do not use '--with-separate-debug-dir')
use_system_debuginfo = True use_system_debuginfo = True
def __init__ (self, architecture_triplet = []): def __init__ (self, architecture_triplet = [], initial_delay = None):
factory.BuildFactory.__init__ (self) factory.BuildFactory.__init__ (self)
self.architecture_triplet = architecture_triplet self.architecture_triplet = architecture_triplet
# mjw asked me to delay the build by X number of seconds.
if initial_delay:
self.addStep (ShellCommand (command = ['sleep', '%d' % initial_delay],
description = "delaying start of build by %d seconds" % initial_delay,
descriptionDone = "delayed start of build by %d seconds" % initial_delay))
self.addStep (RemoveDirectory (dir = WithProperties (r"%s/build", self.addStep (RemoveDirectory (dir = WithProperties (r"%s/build",
r'builddir'), r'builddir'),
description = r"removing old build dir", description = r"removing old build dir",
@ -876,13 +882,21 @@ def load_config (c):
c['builders'] = [] c['builders'] = []
for b in config['builders']: for b in config['builders']:
myenv = {} myenv = {}
if 'arch_triplet' in b: if 'arch_triplet' in b:
architecture_triplet = [ b.pop ('arch_triplet') ] architecture_triplet = [ b.pop ('arch_triplet') ]
else: else:
architecture_triplet = [] architecture_triplet = []
if 'initial_delay' in b:
initial_delay = int (b.pop ('initial_delay'))
else:
initial_delay = None
btype = b.pop ('type') btype = b.pop ('type')
factory = globals ()[ "RunTestGDB%s" % btype ] factory = globals ()[ "RunTestGDB%s" % btype ]
b['factory'] = factory (architecture_triplet = architecture_triplet) b['factory'] = factory (architecture_triplet = architecture_triplet,
initial_delay = initial_delay)
b['canStartBuild'] = DefaultGDBCanStartBuild b['canStartBuild'] = DefaultGDBCanStartBuild
b['mergeRequests'] = False b['mergeRequests'] = False