From bf8056a061868f780bb1931418aa788add131e66 Mon Sep 17 00:00:00 2001 From: Celso Providelo Date: Wed, 11 Feb 2015 09:45:20 -0500 Subject: [PATCH] Cope with missing/broken results due to outdated apt cache. Britney will not fail, but source promotion will be blocked. --- boottest.py | 13 ++++++++++++- britney.conf | 2 +- tests/test_boottest.py | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/boottest.py b/boottest.py index 0effc50..74e3552 100644 --- a/boottest.py +++ b/boottest.py @@ -215,7 +215,18 @@ class BootTest(object): def get_status(self, name, version): """Return test status for the given source name and version.""" - return self.pkglist[name][version] + try: + return self.pkglist[name][version] + except KeyError: + # This error handling accounts for outdated apt caches, when + # `boottest-britney` erroneously reports results for the + # current source version, instead of the proposed. + # Returning None here will block source promotion with: + # 'UNKNOWN STATUS' excuse. If the jobs are retried and its + # results find an up-to-date cache, the problem is gone. + print("E: [%s] - Missing boottest results for %s_%s" % ( + time.asctime(), name, version)) + return None def request(self, packages): """Requests boottests for the given sources list ([(src, ver),]).""" diff --git a/britney.conf b/britney.conf index 827bd1f..8d9b285 100644 --- a/britney.conf +++ b/britney.conf @@ -66,7 +66,7 @@ ADT_ENABLE = yes ADT_DEBUG = no ADT_ARCHES = amd64 i386 -BOOTTEST_ARCHES = armhf BOOTTEST_ENABLE = yes BOOTTEST_DEBUG = yes +BOOTTEST_ARCHES = armhf amd64 BOOTTEST_FETCH = yes diff --git a/tests/test_boottest.py b/tests/test_boottest.py index b8ce9ed..6b0d088 100644 --- a/tests/test_boottest.py +++ b/tests/test_boottest.py @@ -301,6 +301,22 @@ args.func() boottest.BootTest.EXCUSE_LABELS['FAIL']), '
  • Not considered']) + def test_unknonw(self): + # `Britney` does not block on missing boottest results for a + # particular source/version, in this case pyqt5-src_1.2 (not + # listed in the testing result history). Instead it renders + # excuses with 'UNKNOWN STATUS' and links to the corresponding + # jenkins jobs for further investigation. Source promotion is + # blocked, though. + context = [ + ('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.2', + 'Architecture': 'armhf'})] + self.do_test( + context, + [r'\bpyqt5-src\b.*\(- to .*>1.2<', + r'
  • Boottest result: UNKNOWN STATUS \(Jenkins: .*\)', + '
  • Not considered']) + def create_hint(self, username, content): """Populates a hint file for the given 'username' with 'content'.""" hints_path = os.path.join(