Run/show autopkgtests for force-skiptest again

Revert commit 551/bug 1522893 again, as we still want to see test results even
for force-skip'ed packages in some cases.

In cases where we really don't want to run the tests at all, we need to flush
the AMQP queues manually and remove pending.json after the package got
accepted.
bzr-import-20160707
Martin Pitt 9 years ago
parent ac979a9e1e
commit cc46972caa

@ -1931,33 +1931,10 @@ class Britney(object):
if e.ver[1] == "-":
continue
autopkgtest_excuses.append(e)
# don't request tests if we have a force-skiptest hint
hints = self.hints.search('force-skiptest', package=e.name)
hints.extend(self.hints.search('force', package=e.name))
forces = [
x for x in hints
if same_source(e.ver[1], x.version) ]
if not forces:
autopkgtest_packages.append((e.name, e.ver[1]))
autopkgtest_packages.append((e.name, e.ver[1]))
autopkgtest.request(autopkgtest_packages, autopkgtest_excludes)
cloud_url = "http://autopkgtest.ubuntu.com/packages/%(h)s/%(s)s/%(r)s/%(a)s"
for e in autopkgtest_excuses:
# do we skip autopkgtests altogether?
hints = self.hints.search('force-skiptest', package=e.name)
hints.extend(self.hints.search('force', package=e.name))
forces = [
x for x in hints
if same_source(e.ver[1], x.version) ]
if forces:
e.force()
e.addreason('skiptest')
e.addhtml(
"Should wait for tests relating to %s %s, but "
"forced by %s" %
(e.name, e.ver[1], forces[0].user))
continue
adtpass = True
for passed, adtsrc, adtver, arch_status in autopkgtest.results(
e.name, e.ver[1]):
@ -1982,15 +1959,25 @@ class Britney(object):
if not passed:
adtpass = False
if not adtpass:
try:
if not adtpass and e.is_valid:
hints = self.hints.search('force-skiptest', package=e.name)
hints.extend(self.hints.search('force', package=e.name))
forces = [
x for x in hints
if same_source(e.ver[1], x.version) ]
if forces:
e.force()
e.addreason('skiptest')
e.addhtml(
"Should wait for tests relating to %s %s, but "
"forced by %s" %
(e.name, e.ver[1], forces[0].user))
else:
upgrade_me.remove(e.name)
unconsidered.append(e.name)
except ValueError:
pass
e.addhtml("Not considered")
e.addreason("autopkgtest")
e.is_valid = False
e.addhtml("Not considered")
e.addreason("autopkgtest")
e.is_valid = False
# invalidate impossible excuses
for e in self.excuses:

@ -1408,24 +1408,25 @@ class T(TestBase):
self.create_hint('pitti', 'force-skiptest green/2')
# green has passed before on i386 only, therefore ALWAYSFAIL on amd64
# regression of green, darkgreen ok, lightgreen running
self.swift.set_results({'autopkgtest-series': {
'series/i386/g/green/20150101_100000@': (0, 'green 1', tr('passedbefore/1')),
'series/i386/g/green/20150101_100200@': (4, 'green 2', tr('green/2')),
'series/i386/d/darkgreen/20150101_100000@': (0, 'darkgreen 1', tr('green/2')),
'series/amd64/d/darkgreen/20150101_100000@': (0, 'darkgreen 1', tr('green/2')),
}})
self.do_test(
[('libgreen1', {'Version': '2', 'Source': 'green', 'Depends': 'libc6'}, 'autopkgtest')],
{'green': (True, {}),
{'green': (True, {'green 2': {'amd64': 'RUNNING-ALWAYSFAIL', 'i386': 'REGRESSION'},
'lightgreen 1': {'amd64': 'RUNNING-ALWAYSFAIL', 'i386': 'RUNNING-ALWAYSFAIL'},
'darkgreen 1': {'amd64': 'PASS', 'i386': 'PASS'},
}),
},
{'green': [('old-version', '1'), ('new-version', '2'),
('forced-reason', 'skiptest'),
('excuses', 'Should wait for tests relating to green 2, but forced by pitti')]
})
# should not issue test requests as it's hinted anyway
self.assertEqual(self.amqp_requests, set())
self.assertEqual(self.pending_requests, {})
def test_hint_force_skiptest_different_version(self):
'''force-skiptest hint with non-matching version'''

Loading…
Cancel
Save