Support force-{bad,skip}test hints for multiple versions

bzr-import-20160707
Martin Pitt 9 years ago
parent cacd7d7667
commit 4fa1220bfd

@ -592,15 +592,18 @@ class AutoPackageTest(object):
ever_passed = False ever_passed = False
if ever_passed: if ever_passed:
result = 'REGRESSION'
# do we have a force{,-badtest} hint? # do we have a force{,-badtest} hint?
hints = self.britney.hints.search('force-badtest', package=testsrc) hints = self.britney.hints.search('force-badtest', package=testsrc)
hints.extend(self.britney.hints.search('force', package=testsrc)) hints.extend(self.britney.hints.search('force', package=testsrc))
for h in hints: if hints:
if same_source(h.version, testver): self.log_verbose('Checking hints for %s/%s/%s: %s' % (testsrc, testver, arch, [str(h) for h in hints]))
result = 'IGNORE-FAIL' for hint in hints:
break if [mi for mi in hint.packages if mi.architecture in ['source', arch] and
else: same_source(mi.version, testver)]:
result = 'REGRESSION' result = 'IGNORE-FAIL'
break
else: else:
result = 'ALWAYSFAIL' result = 'ALWAYSFAIL'

@ -1061,7 +1061,7 @@ class Britney(object):
self.__log("Ignoring %s[%s] = ('%s', '%s'), ('%s', '%s') is higher or equal" % self.__log("Ignoring %s[%s] = ('%s', '%s'), ('%s', '%s') is higher or equal" %
(x, package, hint.version, hint.user, hint2.version, hint2.user), type="W") (x, package, hint.version, hint.user, hint2.version, hint2.user), type="W")
hint.set_active(False) hint.set_active(False)
else: elif x not in ["force-badtest", "force-skiptest"]:
self.__log("Overriding %s[%s] = ('%s', '%s', '%s') with ('%s', '%s', '%s')" % self.__log("Overriding %s[%s] = ('%s', '%s', '%s') with ('%s', '%s', '%s')" %
(x, package, hint2.version, hint2.user, hint2.days, (x, package, hint2.version, hint2.user, hint2.days,
hint.version, hint.user, hint.days), type="W") hint.version, hint.user, hint.days), type="W")

@ -181,5 +181,6 @@ class TestBase(unittest.TestCase):
hints_path = os.path.join( hints_path = os.path.join(
self.data.path, 'data', self.data.series + '-proposed', 'Hints', username) self.data.path, 'data', self.data.series + '-proposed', 'Hints', username)
with open(hints_path, 'w') as fd: with open(hints_path, 'a') as fd:
fd.write(content) fd.write(content)
fd.write('\n')

@ -1262,6 +1262,47 @@ class T(TestBase):
{'green': [('old-version', '1'), ('new-version', '2')] {'green': [('old-version', '1'), ('new-version', '2')]
}) })
def test_hint_force_badtest_multi_version(self):
'''force-badtest hint'''
self.swift.set_results({'autopkgtest-series': {
'series/i386/d/darkgreen/20150101_100000@': (0, 'darkgreen 1', tr('green/2')),
'series/amd64/d/darkgreen/20150101_100000@': (0, 'darkgreen 1', tr('green/2')),
'series/i386/l/lightgreen/20150101_100100@': (0, 'lightgreen 1', tr('green/1')),
'series/i386/l/lightgreen/20150101_100101@': (4, 'lightgreen 1', tr('green/2')),
'series/amd64/l/lightgreen/20150101_100100@': (0, 'lightgreen 1', tr('green/1')),
'series/amd64/l/lightgreen/20150101_100101@': (4, 'lightgreen 2', tr('green/2')),
'series/i386/g/green/20150101_100200@': (0, 'green 2', tr('green/2')),
'series/amd64/g/green/20150101_100200@': (0, 'green 2', tr('green/2')),
}})
self.create_hint('pitti', 'force-badtest lightgreen/1')
self.do_test(
[('libgreen1', {'Version': '2', 'Source': 'green', 'Depends': 'libc6'}, 'autopkgtest')],
{'green': (False, {'green 2': {'amd64': 'PASS', 'i386': 'PASS'},
'lightgreen 1': {'i386': 'IGNORE-FAIL'},
'lightgreen 2': {'amd64': 'REGRESSION',},
'darkgreen 1': {'amd64': 'PASS', 'i386': 'PASS'},
}),
},
{'green': [('old-version', '1'), ('new-version', '2')]
})
# hint the version on amd64 too
self.create_hint('pitti', 'force-badtest lightgreen/2')
self.do_test(
[],
{'green': (True, {'green 2': {'amd64': 'PASS', 'i386': 'PASS'},
'lightgreen 1': {'i386': 'IGNORE-FAIL'},
'lightgreen 2': {'amd64': 'IGNORE-FAIL',},
'darkgreen 1': {'amd64': 'PASS', 'i386': 'PASS'},
}),
},
{'green': [('old-version', '1'), ('new-version', '2')]
})
def test_hint_force_badtest_different_version(self): def test_hint_force_badtest_different_version(self):
'''force-badtest hint with non-matching version''' '''force-badtest hint with non-matching version'''

Loading…
Cancel
Save