Add link to the autopkgtest artifacts for PPA runs

For PPA runs we don't have autopkgtest.u.c., thus stop linking to it and
instead directly link to the test artifacts.
This commit is contained in:
Martin Pitt 2016-01-19 21:32:16 +01:00
commit 40d12bfc74
3 changed files with 48 additions and 14 deletions

View File

@ -1963,10 +1963,16 @@ class Britney(object):
for passed, adtsrc, adtver, arch_status in autopkgtest.results( for passed, adtsrc, adtver, arch_status in autopkgtest.results(
e.name, e.ver[1]): e.name, e.ver[1]):
for arch, (status, log_url) in arch_status.items(): for arch, (status, log_url) in arch_status.items():
history_url = cloud_url % {'h': srchash(adtsrc), 's': adtsrc, kwargs = {}
if self.options.adt_ppas:
if log_url.endswith('log.gz'):
kwargs['artifact_url'] = log_url.replace('log.gz', 'artifacts.tar.gz')
else:
kwargs['history_url'] = cloud_url % {
'h': srchash(adtsrc), 's': adtsrc,
'r': self.options.series, 'a': arch} 'r': self.options.series, 'a': arch}
e.addtest('autopkgtest', '%s %s' % (adtsrc, adtver), e.addtest('autopkgtest', '%s %s' % (adtsrc, adtver),
arch, status, log_url, history_url) arch, status, log_url, **kwargs)
# hints can override failures # hints can override failures
if not passed: if not passed:

View File

@ -182,9 +182,13 @@ class Excuse(object):
for pkg in sorted(self.tests[testtype]): for pkg in sorted(self.tests[testtype]):
archmsg = [] archmsg = []
for arch in sorted(self.tests[testtype][pkg]): for arch in sorted(self.tests[testtype][pkg]):
status, log_url, history_url = self.tests[testtype][pkg][arch] status, log_url, history_url, artifact_url = self.tests[testtype][pkg][arch]
archmsg.append('<a href="%s">%s</a>: <a href="%s">%s</a>' % label = EXCUSES_LABELS[status]
(history_url or log_url, arch, log_url, EXCUSES_LABELS[status])) message = '<a href="{history_url}">{arch}</a>' if history_url else '{arch}'
message += ': <a href="{log_url}">{label}</a>'
if artifact_url:
message += ' <a href="{artifact_url}">[artifacts]</a>'
archmsg.append(message.format(**locals()))
res = res + ("<li>%s for %s: %s</li>\n" % (testtype, pkg, ', '.join(archmsg))) res = res + ("<li>%s for %s: %s</li>\n" % (testtype, pkg, ', '.join(archmsg)))
for x in self.htmlline: for x in self.htmlline:
@ -215,9 +219,9 @@ class Excuse(object):
""""adding reason""" """"adding reason"""
self.reason[reason] = 1 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""" """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() # TODO merge with html()
def text(self): def text(self):

View File

@ -194,10 +194,12 @@ class T(TestBase):
{'darkgreen 2': { {'darkgreen 2': {
'amd64': ['RUNNING-ALWAYSFAIL', 'amd64': ['RUNNING-ALWAYSFAIL',
'http://autopkgtest.ubuntu.com/running.shtml', 'http://autopkgtest.ubuntu.com/running.shtml',
'http://autopkgtest.ubuntu.com/packages/d/darkgreen/series/amd64'], 'http://autopkgtest.ubuntu.com/packages/d/darkgreen/series/amd64',
None],
'i386': ['RUNNING-ALWAYSFAIL', 'i386': ['RUNNING-ALWAYSFAIL',
'http://autopkgtest.ubuntu.com/running.shtml', 'http://autopkgtest.ubuntu.com/running.shtml',
'http://autopkgtest.ubuntu.com/packages/d/darkgreen/series/i386']}}}) 'http://autopkgtest.ubuntu.com/packages/d/darkgreen/series/i386',
None]}}})
self.assertEqual(self.pending_requests, self.assertEqual(self.pending_requests,
{'darkgreen/2': {'darkgreen': ['amd64', 'i386']}}) {'darkgreen/2': {'darkgreen': ['amd64', 'i386']}})
@ -1563,11 +1565,22 @@ class T(TestBase):
else: else:
sys.stdout.write(line) sys.stdout.write(line)
self.do_test( exc = self.do_test(
[('lightgreen', {'Version': '2'}, 'autopkgtest')], [('lightgreen', {'Version': '2'}, 'autopkgtest')],
{'lightgreen': (True, {'lightgreen 2': {'amd64': 'RUNNING-ALWAYSFAIL'}})}, {'lightgreen': (True, {'lightgreen 2': {'amd64': 'RUNNING-ALWAYSFAIL'}})},
{'lightgreen': [('old-version', '1'), ('new-version', '2')]} {'lightgreen': [('old-version', '1'), ('new-version', '2')]}
) )[1]
self.assertEqual(exc['lightgreen']['tests'], {'autopkgtest':
{'lightgreen 2': {
'amd64': ['RUNNING-ALWAYSFAIL',
'http://autopkgtest.ubuntu.com/running.shtml',
None,
None],
'i386': ['RUNNING-ALWAYSFAIL',
'http://autopkgtest.ubuntu.com/running.shtml',
None,
None]}
}})
for arch in ['i386', 'amd64']: for arch in ['i386', 'amd64']:
self.assertTrue('debci-series-%s:lightgreen {"triggers": ["lightgreen/2"], "ppas": ["joe/foo", "awesome-developers/staging"]}' % arch in self.amqp_requests or self.assertTrue('debci-series-%s:lightgreen {"triggers": ["lightgreen/2"], "ppas": ["joe/foo", "awesome-developers/staging"]}' % arch in self.amqp_requests or
@ -1580,11 +1593,22 @@ class T(TestBase):
'series/amd64/l/lightgreen/20150101_100101@': (0, 'lightgreen 2', tr('lightgreen/2')), 'series/amd64/l/lightgreen/20150101_100101@': (0, 'lightgreen 2', tr('lightgreen/2')),
}}) }})
self.do_test( exc = self.do_test(
[], [],
{'lightgreen': (True, {'lightgreen 2': {'i386': 'PASS', 'amd64': 'PASS'}})}, {'lightgreen': (True, {'lightgreen 2': {'i386': 'PASS', 'amd64': 'PASS'}})},
{'lightgreen': [('old-version', '1'), ('new-version', '2')]} {'lightgreen': [('old-version', '1'), ('new-version', '2')]}
) )[1]
self.assertEqual(exc['lightgreen']['tests'], {'autopkgtest':
{'lightgreen 2': {
'amd64': ['PASS',
'http://localhost:18085/autopkgtest-series-awesome-developers-staging/series/amd64/l/lightgreen/20150101_100101@/log.gz',
None,
'http://localhost:18085/autopkgtest-series-awesome-developers-staging/series/amd64/l/lightgreen/20150101_100101@/artifacts.tar.gz'],
'i386': ['PASS',
'http://localhost:18085/autopkgtest-series-awesome-developers-staging/series/i386/l/lightgreen/20150101_100100@/log.gz',
None,
'http://localhost:18085/autopkgtest-series-awesome-developers-staging/series/i386/l/lightgreen/20150101_100100@/artifacts.tar.gz']}
}})
self.assertEqual(self.amqp_requests, set()) self.assertEqual(self.amqp_requests, set())
self.assertEqual(self.pending_requests, {}) self.assertEqual(self.pending_requests, {})