From 4c23b25ce20f88f1136ca4d71eaf451bd9c8f66f Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 6 Nov 2015 16:12:01 -0600 Subject: [PATCH] Autopkgtest: Request one test run per trigger for all packages Stop special-casing the kernel and move to one test run per trigger. This allows us to only install the triggering package from unstable and run the rest out of testing, which gives much better isolation. --- autopkgtest.py | 21 +++++++-------------- tests/test_autopkgtest.py | 8 +++++--- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/autopkgtest.py b/autopkgtest.py index 75ce359..5f0effa 100644 --- a/autopkgtest.py +++ b/autopkgtest.py @@ -560,17 +560,13 @@ class AutoPackageTest(object): verinfo is ver -> arch -> {(triggering-src1, ver1), ...}, i. e. an entry of self.requested_tests[arch] - Return pair of ({kernel_trigger1, ...}, {nonkernel_trigger1, ...}) sets. + Return {trigger1, ...}) set. ''' - kernel_triggers = set() - nonkernel_triggers = set() + triggers = set() for archinfo in verinfo.values(): for (t, v) in archinfo.get(arch, []): - if t.startswith('linux-meta'): - kernel_triggers.add(t + '/' + v) - else: - nonkernel_triggers.add(t + '/' + v) - return (kernel_triggers, nonkernel_triggers) + triggers.add(t + '/' + v) + return triggers # build per-queue request strings for new test requests # TODO: Once we support version constraints in AMQP requests, add them @@ -584,12 +580,9 @@ class AutoPackageTest(object): # run just one test for all triggers; but for proposed # kernels we want to run a separate test for each, so that # the test runs under that particular kernel - kernel_triggers, other_triggers = _trigsources(verinfo, arch) - for kt in sorted(kernel_triggers): - params = {'triggers': [kt]} - requests.append((pkg, json.dumps(params))) - if other_triggers: - params = {'triggers': sorted(other_triggers)} + triggers = _trigsources(verinfo, arch) + for t in sorted(triggers): + params = {'triggers': [t]} requests.append((pkg, json.dumps(params))) arch_queues[arch] = ('debci-%s-%s' % (self.series, arch), requests) diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index 51aec0b..5770e67 100755 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -763,13 +763,15 @@ lightgreen 1 i386 green 2 }) # we expect the package's and its reverse dependencies' tests to get - # triggered; lightgreen should be triggered only once + # triggered; lightgreen should be triggered for each trigger self.assertEqual( self.amqp_requests, set(['debci-series-i386:green {"triggers": ["green/2"]}', 'debci-series-amd64:green {"triggers": ["green/2"]}', - 'debci-series-i386:lightgreen {"triggers": ["green/2", "lightgreen/2"]}', - 'debci-series-amd64:lightgreen {"triggers": ["green/2", "lightgreen/2"]}', + 'debci-series-i386:lightgreen {"triggers": ["green/2"]}', + 'debci-series-amd64:lightgreen {"triggers": ["green/2"]}', + 'debci-series-i386:lightgreen {"triggers": ["lightgreen/2"]}', + 'debci-series-amd64:lightgreen {"triggers": ["lightgreen/2"]}', 'debci-series-i386:darkgreen {"triggers": ["green/2"]}', 'debci-series-amd64:darkgreen {"triggers": ["green/2"]}']))