Make force-badtest hints apply to lower versions

We usually bump force-badtest versions for the devel series, which can cause
apparent regressions in stable tests, or when running tests against
devel-release when bumping the version for devel-proposed.
bzr-import-20160707
Martin Pitt 9 years ago
parent 0d0c9f3592
commit e43cec8fad

@ -610,7 +610,7 @@ class AutoPackageTest(object):
self.log_verbose('Checking hints for %s/%s/%s: %s' % (testsrc, testver, arch, [str(h) for h in hints]))
for hint in hints:
if [mi for mi in hint.packages if mi.architecture in ['source', arch] and
(mi.version == 'all' or same_source(mi.version, testver))]:
(mi.version == 'all' or apt_pkg.version_compare(testver, mi.version) <= 0)]:
result = 'IGNORE-FAIL'
break
else:

@ -1368,6 +1368,7 @@ class T(TestBase):
'series/amd64/g/green/20150101_100200@': (0, 'green 2', tr('green/2')),
}})
# lower hint version should not apply
self.create_hint('pitti', 'force-badtest lightgreen/0.1')
exc = self.do_test(
@ -1381,6 +1382,18 @@ class T(TestBase):
)[1]
self.assertNotIn('forced-reason', exc['green'])
# higher hint version should apply
self.create_hint('pitti', 'force-badtest lightgreen/3')
self.do_test(
[],
{'green': (True, {'green 2': {'amd64': 'PASS', 'i386': 'PASS'},
'lightgreen 1': {'amd64': 'IGNORE-FAIL', 'i386': 'IGNORE-FAIL'},
'darkgreen 1': {'amd64': 'PASS', 'i386': 'PASS'},
}),
},
{}
)
def test_hint_force_badtest_arch(self):
'''force-badtest hint for architecture instead of version'''

Loading…
Cancel
Save