builders: Improve log handling to match run-config step numbering

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2018-09-05 14:04:20 +01:00
parent e99165dd4e
commit 24085f2a34
2 changed files with 13 additions and 8 deletions

View File

@ -10,6 +10,7 @@ import json
builders = []
maxsteps = 8
# Environment to pass into the workers, e.g. to load further local configuration
# fragments
@ -120,10 +121,11 @@ def ensure_props_set(props):
"publish_destination": props.getProperty("publish_destination", "")
}
def get_buildlogs():
def get_buildlogs(maxsteps):
logfiles = {}
for i in range(1,30):
logfiles["step" + str(i)] = "build/command.log." + str(i)
for i in range(1, maxsteps):
for j in ['a', 'b', 'c', 'd']:
logfiles["step" + str(i) + str(j)] = "build/command.log." + str(i) + str(j)
return logfiles
def create_builder_factory():
@ -176,8 +178,9 @@ def create_builder_factory():
"-u", util.URLForBuild,
"-q"],
name="run-config",
logfiles=get_buildlogs(),
logfiles=get_buildlogs(maxsteps),
lazylogfiles=True,
maxsteps=maxsteps,
timeout=16200)) # default of 1200s/20min is too short, use 4.5hrs
return f
@ -256,8 +259,9 @@ factory.addStep(RunConfigLogObserver(
"-u", util.URLForBuild,
"-q"],
name="run-config",
logfiles=get_buildlogs(),
logfiles=get_buildlogs(maxsteps),
lazylogfiles=True,
maxsteps=maxsteps,
timeout=16200)) # default of 1200s/20min is too short, use 4.5hrs
# trigger the buildsets contained in the nightly set

View File

@ -18,14 +18,15 @@ class RunConfigLogObserver(ShellCommand):
warnings = 0
errors = 0
def __init__(self, python=None, *args, **kwargs):
def __init__(self, python=None, maxsteps=10, *args, **kwargs):
ShellCommand.__init__(self, *args, **kwargs)
self.python = python
self.warningLines = []
self.errorLines = []
self.addLogObserver('stdio', logobserver.LineConsumerLogObserver(self.logConsumer))
for i in range(1, 30):
self.addLogObserver('step' + str(i), logobserver.LineConsumerLogObserver(self.logConsumer))
for i in range(1, maxsteps):
for j in ['a', 'b', 'c', 'd']:
self.addLogObserver('step' + str(i) + str(j), logobserver.LineConsumerLogObserver(self.logConsumer))
def logConsumer(self):
while True: