mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-04-15 05:01:10 +00:00
Autopkgtest: Fix updating results with explicit triggers
When fetching a result with explicit triggers, always update self.results, not just when we have a pending trigger for it. Otherwise satisfied_triggers will be empty after reading the first result, and we clobber test results for all triggers with the latest result.
This commit is contained in:
parent
9b70fe361d
commit
622115a2fb
@ -429,11 +429,11 @@ class AutoPackageTest(object):
|
||||
# preferred (and robust) way of matching results to pending
|
||||
# requests
|
||||
for result_trigger in result_triggers:
|
||||
satisfied_triggers.add(result_trigger)
|
||||
try:
|
||||
request_map[src][pending_ver][arch].remove(result_trigger)
|
||||
self.log_verbose('-> matches pending request %s/%s/%s for trigger %s' %
|
||||
(src, pending_ver, arch, str(result_trigger)))
|
||||
satisfied_triggers.add(result_trigger)
|
||||
except (KeyError, ValueError):
|
||||
self.log_verbose('-> does not match any pending request for %s/%s/%s' %
|
||||
(src, pending_ver, arch))
|
||||
|
@ -1271,6 +1271,38 @@ fancy 1 i386 linux-meta-lts-grumpy 1
|
||||
|
||||
self.assertEqual(self.pending_requests, 'fancy 1 amd64 linux-meta-lts-grumpy 1\n')
|
||||
|
||||
def test_dkms_results_per_kernel_old_results(self):
|
||||
'''DKMS results get mapped to the triggering kernel version, old results'''
|
||||
|
||||
self.data.add('dkms', False, {})
|
||||
self.data.add('fancy-dkms', False, {'Source': 'fancy', 'Depends': 'dkms (>= 1)'})
|
||||
|
||||
# works against linux-meta and -64only, fails against grumpy i386, no
|
||||
# result yet for grumpy amd64
|
||||
self.swift.set_results({'autopkgtest-series': {
|
||||
# old results without trigger info
|
||||
'series/i386/f/fancy/20140101_100101@': (0, 'fancy 1', {}),
|
||||
'series/amd64/f/fancy/20140101_100101@': (8, 'fancy 1', {}),
|
||||
# current results with triggers
|
||||
'series/i386/f/fancy/20150101_100101@': (0, 'fancy 1', {'custom_environment': ['ADT_TEST_TRIGGERS=linux-meta/1']}),
|
||||
'series/amd64/f/fancy/20150101_100101@': (0, 'fancy 1', {'custom_environment': ['ADT_TEST_TRIGGERS=linux-meta/1']}),
|
||||
'series/amd64/f/fancy/20150101_100201@': (0, 'fancy 1', {'custom_environment': ['ADT_TEST_TRIGGERS=linux-meta-64only/1']}),
|
||||
'series/i386/f/fancy/20150101_100301@': (4, 'fancy 1', {'custom_environment': ['ADT_TEST_TRIGGERS=linux-meta-lts-grumpy/1']}),
|
||||
}})
|
||||
|
||||
self.do_test(
|
||||
[('linux-image-generic', {'Source': 'linux-meta'}, None),
|
||||
('linux-image-grumpy-generic', {'Source': 'linux-meta-lts-grumpy'}, None),
|
||||
('linux-image-64only', {'Source': 'linux-meta-64only', 'Architecture': 'amd64'}, None),
|
||||
],
|
||||
{'linux-meta': (True, {'fancy 1': {'amd64': 'PASS', 'i386': 'PASS'}}),
|
||||
# we don't have an explicit result for amd64, so the old one counts
|
||||
'linux-meta-lts-grumpy': (False, {'fancy 1': {'amd64': 'REGRESSION', 'i386': 'REGRESSION'}}),
|
||||
'linux-meta-64only': (True, {'fancy 1': {'amd64': 'PASS'}}),
|
||||
})
|
||||
|
||||
self.assertEqual(self.pending_requests, '')
|
||||
|
||||
def test_kernel_triggers_lxc(self):
|
||||
'''LXC test gets triggered by kernel uploads'''
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user