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

View File

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