From e412932daf0d3744bc2114eaa81b91b7673d7914 Mon Sep 17 00:00:00 2001 From: Robert Bruce Park Date: Tue, 19 Jan 2016 11:08:11 -0800 Subject: [PATCH] Set artifacts link if ADT_PPAS is defined. --- britney.py | 5 ++++- excuse.py | 17 +++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/britney.py b/britney.py index e62dd90..5688d10 100755 --- a/britney.py +++ b/britney.py @@ -1965,8 +1965,11 @@ class Britney(object): for arch, (status, log_url) in arch_status.items(): history_url = cloud_url % {'h': srchash(adtsrc), 's': adtsrc, 'r': self.options.series, 'a': arch} + artifact_url = None + if self.options.adt_ppas: + artifact_url = log_url.replace('log.gz', 'artifact.tar.gz') e.addtest('autopkgtest', '%s %s' % (adtsrc, adtver), - arch, status, log_url, history_url) + arch, status, log_url, history_url, artifact_url) # hints can override failures if not passed: diff --git a/excuse.py b/excuse.py index ab89b0c..0238798 100644 --- a/excuse.py +++ b/excuse.py @@ -182,9 +182,15 @@ class Excuse(object): for pkg in sorted(self.tests[testtype]): archmsg = [] for arch in sorted(self.tests[testtype][pkg]): - status, log_url, history_url = self.tests[testtype][pkg][arch] - archmsg.append('%s: %s' % - (history_url or log_url, arch, log_url, EXCUSES_LABELS[status])) + status, log_url, history_url, artifact_url = self.tests[testtype][pkg][arch] + label = EXCUSES_LABELS[status] + if artifact_url: + message = '{arch}: {label} [artifacts]' + elif history_url: + message = '{arch}: {label}' + else: + message = '{arch}: {label}' + archmsg.append(message.format(**locals())) res = res + ("
  • %s for %s: %s
  • \n" % (testtype, pkg, ', '.join(archmsg))) for x in self.htmlline: @@ -215,9 +221,9 @@ class Excuse(object): """"adding reason""" self.reason[reason] = 1 - def addtest(self, type_, package, arch, state, log_url, history_url=None): + def addtest(self, type_, package, arch, state, log_url, history_url=None, artifact_url=None): """Add test result""" - self.tests.setdefault(type_, {}).setdefault(package, {})[arch] = [state, log_url, history_url] + self.tests.setdefault(type_, {}).setdefault(package, {})[arch] = [state, log_url, history_url, artifact_url] # TODO merge with html() def text(self): @@ -276,4 +282,3 @@ class Excuse(object): excusedata["is-candidate"] = self.is_valid excusedata["tests"] = self.tests return excusedata -