aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-26 13:53:58 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-09-26 13:54:00 +0100
commitff2e532acbbb293c92c30c4b8784f8d7ff74d018 (patch)
tree2caef1e5dea43ddf7355f8a9774deda9596e5206
parent22d8500664ea086c09be0f4d2686d526b5957b7f (diff)
downloadyocto-autobuilder2-ff2e532acbbb293c92c30c4b8784f8d7ff74d018.tar.gz
yocto-autobuilder2-ff2e532acbbb293c92c30c4b8784f8d7ff74d018.tar.bz2
yocto-autobuilder2-ff2e532acbbb293c92c30c4b8784f8d7ff74d018.zip
wikilog: Fix log entry formatting to be clearer
This ensures one entry is shown per step with the logs on the same line. The logs are shown with the log names and the step name is only shown once. This make the resulting wiki entry much easier to use. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--reporters/wikilog.py24
1 files changed, 9 insertions, 15 deletions
diff --git a/reporters/wikilog.py b/reporters/wikilog.py
index cab69e2..23f4ad5 100644
--- a/reporters/wikilog.py
+++ b/reporters/wikilog.py
@@ -164,8 +164,10 @@ class WikiLog(service.BuildbotService):
parent = build
url = build['url']
+ buildid = build['buildid']
+ builder = build['builder']['name']
log_entries = []
- logfmt = '[%s %s]'
+ logentry = ""
for s in build['steps']:
# Ignore logs for steps which succeeded/cancelled
@@ -182,10 +184,13 @@ class WikiLog(service.BuildbotService):
step_number = s['number']
logs = yield self.master.data.get(("steps", s['stepid'], 'logs'))
logs = list(logs)
+ logstring = []
for l in logs:
log_url = '%s/steps/%s/logs/%s' % (url, step_number, l['name'])
- log_entry = logfmt % (log_url, step_name)
- log_entries.append(log_entry)
+ logstring.append('[%s %s]' % (log_url, l['name']))
+
+ logs = ' '.join(logstring)
+ logentry = logentry + '\n* [%s %s] %s failed: %s\n' % (url, builder, step_name, logs)
blurb, entries = self.wiki.get_content(self.wiki_page)
if not blurb:
@@ -222,18 +227,7 @@ class WikiLog(service.BuildbotService):
log.err(errmsg.format(buildid, parent['url']))
return False
- new_entry = entry
- buildid = build['buildid']
- builder = build['builder']['name']
-
- if len(log_entries) > 0:
- logs = ''
- log_fmt = '\n** '
- builderfmt = '\n* [%s %s] failed' % (url, builder)
- builderfmt = builderfmt + ': ' + log_fmt
- logs = log_fmt.join(log_entries)
- logs = logs + '\n'
- new_entry = '\n' + entry.strip() + builderfmt + logs
+ new_entry = '\n' + entry.strip() + logentry
summary = 'Updating entry with failures in %s' % builder
summary = summary + self.idstring