From cc46972caaa7acc1e264081b1ecf8576b6112438 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Mon, 21 Mar 2016 10:47:47 +0100 Subject: [PATCH] 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. --- britney.py | 49 ++++++++++++++------------------------- tests/test_autopkgtest.py | 15 ++++++------ 2 files changed, 26 insertions(+), 38 deletions(-) diff --git a/britney.py b/britney.py index f7e526d..1acba16 100755 --- a/britney.py +++ b/britney.py @@ -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: diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index dad4853..b78da72 100755 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -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'''