Merge lp:~robru/britney/adt-artifacts into lp:~ubuntu-release/britney/britney2-ubuntu

Proposed by Robert Bruce Park
Status: Merged
Merged at revision: 561
Proposed branch: lp:~robru/britney/adt-artifacts
Merge into: lp:~ubuntu-release/britney/britney2-ubuntu
Diff against target: 135 lines (+47/-15)
3 files modified
britney.py (+9/-3)
excuse.py (+9/-6)
tests/test_autopkgtest.py (+29/-6)
To merge this branch: bzr merge lp:~robru/britney/adt-artifacts
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+283198@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Don't merge this, it's broken and conceptually incomplete still.

review: Needs Fixing
Revision history for this message
Martin Pitt (pitti) :
review: Needs Fixing
lp:~robru/britney/adt-artifacts updated
561. By Robert Bruce Park

Set artifacts link if ADT_PPAS is defined.

Revision history for this message
Martin Pitt (pitti) wrote :

We're getting much closer, thanks!

lp:~robru/britney/adt-artifacts updated
562. By Robert Bruce Park

Fix URL.

563. By Robert Bruce Park

Iterate.

564. By Robert Bruce Park

Stop setting artifacts link if log is running.shtml.

565. By Robert Bruce Park

Add & fix tests.

Revision history for this message
Martin Pitt (pitti) wrote :

Merged with removing the stray whitespace change and dropping the maxDiff addition again (that should go into a separate commit). Many thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'britney.py'
2--- britney.py 2015-12-18 15:37:23 +0000
3+++ britney.py 2016-01-19 20:23:04 +0000
4@@ -1963,10 +1963,16 @@
5 for passed, adtsrc, adtver, arch_status in autopkgtest.results(
6 e.name, e.ver[1]):
7 for arch, (status, log_url) in arch_status.items():
8- history_url = cloud_url % {'h': srchash(adtsrc), 's': adtsrc,
9- 'r': self.options.series, 'a': arch}
10+ kwargs = {}
11+ if self.options.adt_ppas:
12+ if log_url.endswith('log.gz'):
13+ kwargs['artifact_url'] = log_url.replace('log.gz', 'artifacts.tar.gz')
14+ else:
15+ kwargs['history_url'] = cloud_url % {
16+ 'h': srchash(adtsrc), 's': adtsrc,
17+ 'r': self.options.series, 'a': arch}
18 e.addtest('autopkgtest', '%s %s' % (adtsrc, adtver),
19- arch, status, log_url, history_url)
20+ arch, status, log_url, **kwargs)
21
22 # hints can override failures
23 if not passed:
24
25=== modified file 'excuse.py'
26--- excuse.py 2015-12-14 15:57:19 +0000
27+++ excuse.py 2016-01-19 20:23:04 +0000
28@@ -182,9 +182,13 @@
29 for pkg in sorted(self.tests[testtype]):
30 archmsg = []
31 for arch in sorted(self.tests[testtype][pkg]):
32- status, log_url, history_url = self.tests[testtype][pkg][arch]
33- archmsg.append('<a href="%s">%s</a>: <a href="%s">%s</a>' %
34- (history_url or log_url, arch, log_url, EXCUSES_LABELS[status]))
35+ status, log_url, history_url, artifact_url = self.tests[testtype][pkg][arch]
36+ label = EXCUSES_LABELS[status]
37+ message = '<a href="{history_url}">{arch}</a>' if history_url else '{arch}'
38+ message += ': <a href="{log_url}">{label}</a>'
39+ if artifact_url:
40+ message += ' <a href="{artifact_url}">[artifacts]</a>'
41+ archmsg.append(message.format(**locals()))
42 res = res + ("<li>%s for %s: %s</li>\n" % (testtype, pkg, ', '.join(archmsg)))
43
44 for x in self.htmlline:
45@@ -215,9 +219,9 @@
46 """"adding reason"""
47 self.reason[reason] = 1
48
49- def addtest(self, type_, package, arch, state, log_url, history_url=None):
50+ def addtest(self, type_, package, arch, state, log_url, history_url=None, artifact_url=None):
51 """Add test result"""
52- self.tests.setdefault(type_, {}).setdefault(package, {})[arch] = [state, log_url, history_url]
53+ self.tests.setdefault(type_, {}).setdefault(package, {})[arch] = [state, log_url, history_url, artifact_url]
54
55 # TODO merge with html()
56 def text(self):
57@@ -276,4 +280,3 @@
58 excusedata["is-candidate"] = self.is_valid
59 excusedata["tests"] = self.tests
60 return excusedata
61-
62
63=== modified file 'tests/test_autopkgtest.py'
64--- tests/test_autopkgtest.py 2015-12-18 15:37:23 +0000
65+++ tests/test_autopkgtest.py 2016-01-19 20:23:04 +0000
66@@ -38,6 +38,7 @@
67
68 def setUp(self):
69 super().setUp()
70+ self.maxDiff = None
71 self.fake_amqp = os.path.join(self.data.path, 'amqp')
72
73 # Disable boottests and set fake AMQP and Swift server
74@@ -194,10 +195,12 @@
75 {'darkgreen 2': {
76 'amd64': ['RUNNING-ALWAYSFAIL',
77 'http://autopkgtest.ubuntu.com/running.shtml',
78- 'http://autopkgtest.ubuntu.com/packages/d/darkgreen/series/amd64'],
79+ 'http://autopkgtest.ubuntu.com/packages/d/darkgreen/series/amd64',
80+ None],
81 'i386': ['RUNNING-ALWAYSFAIL',
82 'http://autopkgtest.ubuntu.com/running.shtml',
83- 'http://autopkgtest.ubuntu.com/packages/d/darkgreen/series/i386']}}})
84+ 'http://autopkgtest.ubuntu.com/packages/d/darkgreen/series/i386',
85+ None]}}})
86
87 self.assertEqual(self.pending_requests,
88 {'darkgreen/2': {'darkgreen': ['amd64', 'i386']}})
89@@ -1563,11 +1566,21 @@
90 else:
91 sys.stdout.write(line)
92
93- self.do_test(
94+ exc = self.do_test(
95 [('lightgreen', {'Version': '2'}, 'autopkgtest')],
96 {'lightgreen': (True, {'lightgreen 2': {'amd64': 'RUNNING-ALWAYSFAIL'}})},
97 {'lightgreen': [('old-version', '1'), ('new-version', '2')]}
98- )
99+ )[1]
100+ self.assertEqual(exc['lightgreen']['tests'], {'autopkgtest':
101+ {'lightgreen 2': {
102+ 'amd64': ['RUNNING-ALWAYSFAIL',
103+ 'http://autopkgtest.ubuntu.com/running.shtml',
104+ None,
105+ None],
106+ 'i386': ['RUNNING-ALWAYSFAIL',
107+ 'http://autopkgtest.ubuntu.com/running.shtml',
108+ None,
109+ None]}}})
110
111 for arch in ['i386', 'amd64']:
112 self.assertTrue('debci-series-%s:lightgreen {"triggers": ["lightgreen/2"], "ppas": ["joe/foo", "awesome-developers/staging"]}' % arch in self.amqp_requests or
113@@ -1580,11 +1593,21 @@
114 'series/amd64/l/lightgreen/20150101_100101@': (0, 'lightgreen 2', tr('lightgreen/2')),
115 }})
116
117- self.do_test(
118+ exc = self.do_test(
119 [],
120 {'lightgreen': (True, {'lightgreen 2': {'i386': 'PASS', 'amd64': 'PASS'}})},
121 {'lightgreen': [('old-version', '1'), ('new-version', '2')]}
122- )
123+ )[1]
124+ self.assertEqual(exc['lightgreen']['tests'], {'autopkgtest':
125+ {'lightgreen 2': {
126+ 'amd64': ['PASS',
127+ 'http://localhost:18085/autopkgtest-series-awesome-developers-staging/series/amd64/l/lightgreen/20150101_100101@/log.gz',
128+ None,
129+ 'http://localhost:18085/autopkgtest-series-awesome-developers-staging/series/amd64/l/lightgreen/20150101_100101@/artifacts.tar.gz'],
130+ 'i386': ['PASS',
131+ 'http://localhost:18085/autopkgtest-series-awesome-developers-staging/series/i386/l/lightgreen/20150101_100100@/log.gz',
132+ None,
133+ 'http://localhost:18085/autopkgtest-series-awesome-developers-staging/series/i386/l/lightgreen/20150101_100100@/artifacts.tar.gz']}}})
134 self.assertEqual(self.amqp_requests, set())
135 self.assertEqual(self.pending_requests, {})
136

Subscribers

People subscribed via source and target branches