From cd49a7eae426d54ff5dce93ee4cca19ec99efd41 Mon Sep 17 00:00:00 2001 From: Celso Providelo Date: Thu, 5 Feb 2015 14:04:52 -0500 Subject: [PATCH 1/5] Calling boottest-britney with -dPU (debug, use -proposed and do not update caches) and also rsyncing boottest data to the correct place on d-jenkins (/var/local/boottest). --- boottest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boottest.py b/boottest.py index 3feae36..44f5b5f 100644 --- a/boottest.py +++ b/boottest.py @@ -165,7 +165,7 @@ class BootTest(object): aptroot: ~/.chdist/%s-proposed-armhf/ apturi: file:%s/mirror/%s components: main restricted universe multiverse - rsync_host: rsync://tachash.ubuntu-ci/adt/ + rsync_host: rsync://tachash.ubuntu-ci/boottest/ datadir: ~/proposed-migration/boottest/data""" % (self.series, self.series, home, self.distribution)), file=rc_file) @@ -178,6 +178,7 @@ class BootTest(object): return '-' command = [ self.script_path, + "-dPU", "-c", self.rc_path, "-r", self.series, ] From 9fb776f4c05a1da76686d89c6466e4edb973153f Mon Sep 17 00:00:00 2001 From: Celso Providelo Date: Thu, 5 Feb 2015 14:13:51 -0500 Subject: [PATCH 2/5] boottest-britney debug options respects BOOTTEST_DEBUG configuration option. --- boottest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/boottest.py b/boottest.py index 44f5b5f..4d3c3b4 100644 --- a/boottest.py +++ b/boottest.py @@ -178,10 +178,12 @@ class BootTest(object): return '-' command = [ self.script_path, - "-dPU", "-c", self.rc_path, "-r", self.series, + "-PU", ] + if self.debug: + command.append("-d") command.extend(args) return subprocess.check_output(command).strip() From 760d08c459c725afc77eb33415d33f40866c368f Mon Sep 17 00:00:00 2001 From: Celso Providelo Date: Thu, 5 Feb 2015 16:42:29 -0500 Subject: [PATCH 3/5] Fix BootTest.get_status to return status for the latest known version. Boottests results are reported for the current (published) version, not the proposed one. --- boottest.py | 15 ++++++++++++--- britney.py | 2 +- tests/test_boottest.py | 10 +++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/boottest.py b/boottest.py index 4d3c3b4..b83668f 100644 --- a/boottest.py +++ b/boottest.py @@ -208,9 +208,11 @@ class BootTest(object): if not (src in self.pkglist and ver in self.pkglist[src]): self.pkglist[src][ver] = status - def get_status(self, name, version): - """Return test status for the given source name and version.""" - return self.pkglist[name][version] + def get_status(self, name): + """Return test status for the given source name.""" + last_version = sorted( + self.pkglist[name], cmp=apt_pkg.version_compare)[-1] + return self.pkglist[name][last_version] def request(self, packages): """Requests boottests for the given sources list ([(src, ver),]).""" @@ -236,6 +238,13 @@ class BootTest(object): """Collects boottests results and updates internal registry.""" self._run("collect", "-O", self._result_path) self._read() + if not self.britney.options.verbose: + return + for src in sorted(self.pkglist): + for ver in sorted(self.pkglist[src], cmp=apt_pkg.version_compare): + status = self.pkglist[src][ver] + print("I: [%s] - Collected boottest status for %s_%s: " + "%s" % (time.asctime(), src, ver, status)) def needs_test(self, name, version): """Whether or not the given source and version should be tested. diff --git a/britney.py b/britney.py index eef23fe..a119ca8 100755 --- a/britney.py +++ b/britney.py @@ -1944,7 +1944,7 @@ class Britney(object): boottest.collect() # Update excuses from the boottest context. for excuse in boottest_excuses: - status = boottest.get_status(excuse.name, excuse.ver[1]) + status = boottest.get_status(excuse.name) label = BootTest.EXCUSE_LABELS.get(status, 'UNKNOWN STATUS') excuse.addhtml("Boottest result: %s" % (label)) # Allows hints to force boottest failures/attempts diff --git a/tests/test_boottest.py b/tests/test_boottest.py index 01772e8..5492240 100644 --- a/tests/test_boottest.py +++ b/tests/test_boottest.py @@ -146,6 +146,7 @@ class TestBoottestEnd2End(TestBase): self.create_manifest([ 'green 1.0', 'pyqt5:armhf 1.0', + 'signon 1.0' ]) def create_manifest(self, lines): @@ -171,6 +172,7 @@ template = """ green 1.1~beta RUNNING pyqt5-src 1.1~beta PASS pyqt5-src 1.1 FAIL +signon 1.0 PASS """ def request(): @@ -190,6 +192,9 @@ def collect(): p = argparse.ArgumentParser() p.add_argument('-r') p.add_argument('-c') +p.add_argument('-d', default=False, action='store_true') +p.add_argument('-P', default=False, action='store_true') +p.add_argument('-U', default=False, action='store_true') sp = p.add_subparsers() @@ -258,11 +263,10 @@ args.func() # promotion. context = [] context.append( - ('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.1~beta', - 'Architecture': 'all'})) + ('signon', {'Version': '1.1', 'Architecture': 'armhf'})) self.do_test( context, - [r'\bpyqt5-src\b.*\(- to .*>1.1~beta<', + [r'\bsignon\b.*\(- to .*>1.1<', '
  • Boottest result: {}'.format( boottest.BootTest.EXCUSE_LABELS['PASS']), '
  • Valid candidate']) From c3c9005d5fcca11eba3e08bb63fe940132119869 Mon Sep 17 00:00:00 2001 From: Celso Providelo Date: Fri, 6 Feb 2015 10:38:36 -0500 Subject: [PATCH 4/5] Restore boottest status lookup by source name & version. --- boottest.py | 8 ++++---- britney.py | 2 +- tests/test_boottest.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/boottest.py b/boottest.py index b83668f..01c9922 100644 --- a/boottest.py +++ b/boottest.py @@ -208,11 +208,11 @@ class BootTest(object): if not (src in self.pkglist and ver in self.pkglist[src]): self.pkglist[src][ver] = status - def get_status(self, name): + def get_status(self, name, version): """Return test status for the given source name.""" - last_version = sorted( - self.pkglist[name], cmp=apt_pkg.version_compare)[-1] - return self.pkglist[name][last_version] + #version = sorted( + # self.pkglist[name], cmp=apt_pkg.version_compare)[-1] + return self.pkglist[name][version] def request(self, packages): """Requests boottests for the given sources list ([(src, ver),]).""" diff --git a/britney.py b/britney.py index a119ca8..eef23fe 100755 --- a/britney.py +++ b/britney.py @@ -1944,7 +1944,7 @@ class Britney(object): boottest.collect() # Update excuses from the boottest context. for excuse in boottest_excuses: - status = boottest.get_status(excuse.name) + status = boottest.get_status(excuse.name, excuse.ver[1]) label = BootTest.EXCUSE_LABELS.get(status, 'UNKNOWN STATUS') excuse.addhtml("Boottest result: %s" % (label)) # Allows hints to force boottest failures/attempts diff --git a/tests/test_boottest.py b/tests/test_boottest.py index 5492240..2e56116 100644 --- a/tests/test_boottest.py +++ b/tests/test_boottest.py @@ -172,7 +172,7 @@ template = """ green 1.1~beta RUNNING pyqt5-src 1.1~beta PASS pyqt5-src 1.1 FAIL -signon 1.0 PASS +signon 1.1 PASS """ def request(): From f98bab42b20d749d8a1dae92037ded6a8873509b Mon Sep 17 00:00:00 2001 From: Celso Providelo Date: Fri, 6 Feb 2015 11:16:41 -0500 Subject: [PATCH 5/5] Re-fix get_status() doc string and remove commented code. --- boottest.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/boottest.py b/boottest.py index 01c9922..f7fcf23 100644 --- a/boottest.py +++ b/boottest.py @@ -209,9 +209,7 @@ class BootTest(object): self.pkglist[src][ver] = status def get_status(self, name, version): - """Return test status for the given source name.""" - #version = sorted( - # self.pkglist[name], cmp=apt_pkg.version_compare)[-1] + """Return test status for the given source name and version.""" return self.pkglist[name][version] def request(self, packages):