Revert "autopkgtest: Drop retry_url from the excuses as this works different in Debian"

This reverts commit 054830d03f.
ubuntu/rebased
Paul Gevers 7 years ago
parent cb716e3186
commit 9a28ec184b
No known key found for this signature in database
GPG Key ID: 9C5C99EB05BD750A

@ -254,6 +254,7 @@ class AutopkgtestPolicy(BasePolicy):
for arch in sorted(arch_results): for arch in sorted(arch_results):
(status, log_url) = arch_results[arch] (status, log_url) = arch_results[arch]
artifact_url = None artifact_url = None
retry_url = None
history_url = None history_url = None
if self.options.adt_ppas: if self.options.adt_ppas:
if log_url.endswith('log.gz'): if log_url.endswith('log.gz'):
@ -262,13 +263,20 @@ class AutopkgtestPolicy(BasePolicy):
history_url = cloud_url % { history_url = cloud_url % {
'h': srchash(testsrc), 's': testsrc, 'h': srchash(testsrc), 's': testsrc,
'r': self.options.series, 'a': arch} 'r': self.options.series, 'a': arch}
if status == 'REGRESSION':
retry_url = self.options.adt_ci_url + 'request.cgi?' + \
urllib.parse.urlencode([('release', self.options.series),
('arch', arch),
('package', testsrc),
('trigger', trigger)] +
[('ppa', p) for p in self.options.adt_ppas])
if testver: if testver:
testname = '%s/%s' % (testsrc, testver) testname = '%s/%s' % (testsrc, testver)
else: else:
testname = testsrc testname = testsrc
tests_info.setdefault(testname, {})[arch] = \ tests_info.setdefault(testname, {})[arch] = \
[status, log_url, history_url, artifact_url] [status, log_url, history_url, artifact_url, retry_url]
# render HTML snippet for testsrc entry for current arch # render HTML snippet for testsrc entry for current arch
if history_url: if history_url:
@ -276,6 +284,8 @@ class AutopkgtestPolicy(BasePolicy):
else: else:
message = arch message = arch
message += ': <a href="%s">%s</a>' % (log_url, EXCUSES_LABELS[status]) message += ': <a href="%s">%s</a>' % (log_url, EXCUSES_LABELS[status])
if retry_url:
message += ' <a href="%s" style="text-decoration: none;">♻ </a> ' % retry_url
if artifact_url: if artifact_url:
message += ' <a href="%s">[artifacts]</a>' % artifact_url message += ' <a href="%s">[artifacts]</a>' % artifact_url
html_archmsg.append(message) html_archmsg.append(message)

@ -212,10 +212,12 @@ class T(TestBase):
'amd64': ['RUNNING-ALWAYSFAIL', 'amd64': ['RUNNING-ALWAYSFAIL',
'https://autopkgtest.ubuntu.com/status/pending', 'https://autopkgtest.ubuntu.com/status/pending',
'https://autopkgtest.ubuntu.com/packages/d/darkgreen/testing/amd64', 'https://autopkgtest.ubuntu.com/packages/d/darkgreen/testing/amd64',
None,
None], None],
'i386': ['RUNNING-ALWAYSFAIL', 'i386': ['RUNNING-ALWAYSFAIL',
'https://autopkgtest.ubuntu.com/status/pending', 'https://autopkgtest.ubuntu.com/status/pending',
'https://autopkgtest.ubuntu.com/packages/d/darkgreen/testing/i386', 'https://autopkgtest.ubuntu.com/packages/d/darkgreen/testing/i386',
None,
None]}, None]},
'verdict': 'PASS'}) 'verdict': 'PASS'})
@ -500,6 +502,15 @@ class T(TestBase):
'https://autopkgtest.ubuntu.com/packages/l/lightgreen/testing/amd64', 'https://autopkgtest.ubuntu.com/packages/l/lightgreen/testing/amd64',
None]) None])
# should have retry link for the regressions (not a stable URL, test
# seaprately)
link = urllib.parse.urlparse(exc['green']['policy_info']['autopkgtest']['lightgreen/1']['amd64'][4])
self.assertEqual(link.netloc, 'autopkgtest.ubuntu.com')
self.assertEqual(link.path, '/request.cgi')
self.assertEqual(urllib.parse.parse_qs(link.query),
{'release': ['testing'], 'arch': ['amd64'],
'package': ['lightgreen'], 'trigger': ['green/2']})
# we already had all results before the run, so this should not trigger # we already had all results before the run, so this should not trigger
# any new requests # any new requests
self.assertEqual(self.amqp_requests, set()) self.assertEqual(self.amqp_requests, set())
@ -2220,10 +2231,12 @@ class T(TestBase):
'amd64': ['RUNNING-ALWAYSFAIL', 'amd64': ['RUNNING-ALWAYSFAIL',
'https://autopkgtest.ubuntu.com/status/pending', 'https://autopkgtest.ubuntu.com/status/pending',
None, None,
None,
None], None],
'i386': ['RUNNING-ALWAYSFAIL', 'i386': ['RUNNING-ALWAYSFAIL',
'https://autopkgtest.ubuntu.com/status/pending', 'https://autopkgtest.ubuntu.com/status/pending',
None, None,
None,
None]}, None]},
'verdict': 'PASS'}) 'verdict': 'PASS'})
@ -2250,11 +2263,14 @@ class T(TestBase):
'amd64': ['PASS', 'amd64': ['PASS',
'http://localhost:18085/autopkgtest-testing-awesome-developers-staging/testing/amd64/l/lightgreen/20150101_100101@/log.gz', 'http://localhost:18085/autopkgtest-testing-awesome-developers-staging/testing/amd64/l/lightgreen/20150101_100101@/log.gz',
None, None,
'http://localhost:18085/autopkgtest-testing-awesome-developers-staging/testing/amd64/l/lightgreen/20150101_100101@/artifacts.tar.gz'], 'http://localhost:18085/autopkgtest-testing-awesome-developers-staging/testing/amd64/l/lightgreen/20150101_100101@/artifacts.tar.gz',
None],
'i386': ['REGRESSION', 'i386': ['REGRESSION',
'http://localhost:18085/autopkgtest-testing-awesome-developers-staging/testing/i386/l/lightgreen/20150101_100100@/log.gz', 'http://localhost:18085/autopkgtest-testing-awesome-developers-staging/testing/i386/l/lightgreen/20150101_100100@/log.gz',
None, None,
'http://localhost:18085/autopkgtest-testing-awesome-developers-staging/testing/i386/l/lightgreen/20150101_100100@/artifacts.tar.gz']}, 'http://localhost:18085/autopkgtest-testing-awesome-developers-staging/testing/i386/l/lightgreen/20150101_100100@/artifacts.tar.gz',
'https://autopkgtest.ubuntu.com/request.cgi?release=testing&arch=i386&package=lightgreen&'
'trigger=lightgreen%2F2&ppa=joe%2Ffoo&ppa=awesome-developers%2Fstaging']},
'verdict': 'REJECTED_PERMANENTLY'}) 'verdict': 'REJECTED_PERMANENTLY'})
self.assertEqual(self.amqp_requests, set()) self.assertEqual(self.amqp_requests, set())
self.assertEqual(self.pending_requests, {}) self.assertEqual(self.pending_requests, {})
@ -2440,6 +2456,15 @@ class T(TestBase):
['https://autopkgtest.ubuntu.com/packages/l/lightgreen/testing/amd64', ['https://autopkgtest.ubuntu.com/packages/l/lightgreen/testing/amd64',
None]) None])
# should have retry link for the regressions (not a stable URL, test
# separately)
link = urllib.parse.urlparse(exc['green']['policy_info']['autopkgtest']['lightgreen/1']['amd64'][4])
self.assertEqual(link.netloc, 'autopkgtest.ubuntu.com')
self.assertEqual(link.path, '/request.cgi')
self.assertEqual(urllib.parse.parse_qs(link.query),
{'release': ['testing'], 'arch': ['amd64'],
'package': ['lightgreen'], 'trigger': ['green/2']})
# we already had all results before the run, so this should not trigger # we already had all results before the run, so this should not trigger
# any new requests # any new requests
self.assertEqual(self.amqp_requests, set()) self.assertEqual(self.amqp_requests, set())

Loading…
Cancel
Save