Merge ~ubuntu-release/britney/+git/britney2-ubuntu:dropped-tests into ~ubuntu-release/britney/+git/britney2-ubuntu:master

Proposed by Iain Lane
Status: Merged
Merged at revision: 41d51369f54d695153fcd71043b511883392a5bf
Proposed branch: ~ubuntu-release/britney/+git/britney2-ubuntu:dropped-tests
Merge into: ~ubuntu-release/britney/+git/britney2-ubuntu:master
Diff against target: 57 lines (+36/-0)
2 files modified
britney2/policies/autopkgtest.py (+5/-0)
tests/test_autopkgtest.py (+31/-0)
Reviewer Review Type Date Requested Status
Andy Whitcroft Pending
Steve Langasek Pending
Adam Conrad Pending
Ubuntu Release Team Pending
Review via email: mp+314834@code.launchpad.net

Description of the change

We request tests of packages which have dropped their autopkgtest in unstable. Since we know whether a package has an autopkgtest or not, we can avoid doing this.

Current example is ncbi-tools6 in zesty-proposed.

There's a pass where we directly request tests of the migration item "foo" if it has a test. This bit is okay currently: it will not make a request if foo doesn't have a test in unstable. Then there is a second pass where we trigger test requests for sources which build binaries that depend on foo. I think this is where the problem arises - if foo builds libfoo1 and foo-tools which depends on libfoo1, we trigger a test of foo again even though this is what we are trying to migrate and it no longer has a test.

I think we should ignore foo at this second step - that's what this branch does.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py
2index f06445d..28c3b12 100644
3--- a/britney2/policies/autopkgtest.py
4+++ b/britney2/policies/autopkgtest.py
5@@ -352,6 +352,11 @@ class AutopkgtestPolicy(BasePolicy):
6 for rdep in rdeps:
7 try:
8 rdep_src = binaries_info[rdep.package_name].source
9+ # Don't re-trigger the package itself here; this should
10+ # have been done above if the package still continues to
11+ # have an autopkgtest in unstable.
12+ if rdep_src == src:
13+ continue
14 except KeyError:
15 self.log('%s on %s has no source (NBS?)' % (rdep.package_name, arch))
16 continue
17diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py
18index c982775..ecbeb2c 100755
19--- a/tests/test_autopkgtest.py
20+++ b/tests/test_autopkgtest.py
21@@ -244,6 +244,37 @@ class T(TestBase):
22 self.assertIn('accepted: darkgreen', upgrade_out)
23 self.assertIn('SUCCESS (1/0)', upgrade_out)
24
25+ def test_dropped_test_not_run(self):
26+ '''New version of a package drops its autopkgtest'''
27+
28+ # green has passed on amd64 before
29+ # lightgreen has passed on i386, therefore we should block on it returning
30+ self.swift.set_results({'autopkgtest-series': {
31+ 'series/amd64/g/green/20150101_100000@': (0, 'green 4', tr('green/1')),
32+ 'series/i386/l/lightgreen/20150101_100100@': (0, 'lightgreen 1', tr('green/1')),
33+ }})
34+
35+ self.do_test(
36+ [('libgreen1', {'Version': '2', 'Source': 'green'}, None)],
37+ {'green': (False, {'lightgreen': {'amd64': 'RUNNING-ALWAYSFAIL', 'i386': 'RUNNING'}})
38+ },
39+ {'green': [('old-version', '1'), ('new-version', '2'),
40+ ('reason', 'autopkgtest')]})
41+
42+ # we expect the package's reverse dependencies' tests to get triggered,
43+ # but *not* the package itself since it has no autopkgtest any more
44+ self.assertEqual(
45+ self.amqp_requests,
46+ set(['debci-series-i386:lightgreen {"triggers": ["green/2"]}',
47+ 'debci-series-amd64:lightgreen {"triggers": ["green/2"]}',
48+ 'debci-series-i386:darkgreen {"triggers": ["green/2"]}',
49+ 'debci-series-amd64:darkgreen {"triggers": ["green/2"]}']))
50+
51+ # ... and that they get recorded as pending
52+ expected_pending = {'green/2': {'darkgreen': ['amd64', 'i386'],
53+ 'lightgreen': ['amd64', 'i386']}}
54+ self.assertEqual(self.pending_requests, expected_pending)
55+
56 def test_multi_rdepends_with_tests_all_running(self):
57 '''Multiple reverse dependencies with tests (all running)'''
58

Subscribers

People subscribed via source and target branches