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.
bzr-import-20160707
Martin Pitt 9 years ago
parent 1a4a37cb02
commit 4c23b25ce2

@ -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)

@ -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"]}']))

Loading…
Cancel
Save