Check phone-image presence for all binary files for the give excused sourcename. Tests improved.

bzr-import-20160707
Celso Providelo 10 years ago
parent 26d134e011
commit cc9097e2ed

@ -13,6 +13,8 @@
# GNU General Public License for more details. # GNU General Public License for more details.
import os import os
from consts import BINARIES
class TouchManifest(object): class TouchManifest(object):
"""Parses a corresponding touch image manifest. """Parses a corresponding touch image manifest.
@ -75,7 +77,7 @@ class BootTest(object):
def _get_status_label(self, name, version): def _get_status_label(self, name, version):
"""Return the current boottest status label.""" """Return the current boottest status label."""
# XXX cprov 20150120: replace with the test history latest # XXX cprov 20150120: replace with the test history latest
# record label. # record label, or a new job request if it was not found.
if name == 'pyqt5': if name == 'pyqt5':
if version == '1.1~beta': if version == '1.1~beta':
return 'PASS' return 'PASS'
@ -93,17 +95,33 @@ class BootTest(object):
Annotate skipped packages (currently not in phone image) or add Annotate skipped packages (currently not in phone image) or add
the current testing status (see `_get_status_label`). the current testing status (see `_get_status_label`).
""" """
if excuse.name not in self.phone_manifest: # Discover all binaries for the 'excused' source.
label = 'SKIPPED' unstable_sources = self.britney.sources['unstable']
else: binary_names = [
label = self._get_status_label(excuse.name, excuse.ver[1]) bin.split('/')[0]
for bin in unstable_sources[excuse.name][BINARIES]
excuse.addhtml("boottest for %s %s: %s" % ]
(excuse.name, excuse.ver[1], label))
# Process (request or update) boottest attempts for each binary.
if label in ['PASS', 'SKIPPED']: labels = set()
for name in binary_names:
if name in self.phone_manifest:
label = self._get_status_label(name, excuse.ver[1])
else:
label = 'SKIPPED'
excuse.addhtml("boottest for %s %s: %s" %
(name, excuse.ver[1], label))
labels.add(label)
# If all boottests passed or were skipped, return False. The
# excuse is clean and promotion can proceed, according to the
# boottest criteria.
if labels.issubset(set(['PASS', 'SKIPPED'])):
return False return False
# If one or more boottests are still in-progress or have already
# failed, make the excuse as invalid and blocks promotion by
# returning True.
excuse.addhtml("Not considered") excuse.addhtml("Not considered")
excuse.addreason("boottest") excuse.addreason("boottest")
excuse.is_valid = False excuse.is_valid = False

@ -81,7 +81,7 @@ class TestBoottestEnd2End(TestBase):
self.data.add( self.data.add(
'green', 'green',
False, False,
{'Depends': 'libc6 (>= 0.9), libgreen1'}) {'Source': 'green', 'Depends': 'libc6 (>= 0.9), libgreen1'})
self.create_manifest([ self.create_manifest([
'green 1.0', 'green 1.0',
'pyqt5:armhf 1.0', 'pyqt5:armhf 1.0',
@ -108,15 +108,21 @@ class TestBoottestEnd2End(TestBase):
self.assertNotRegexpMatches(excuses, re) self.assertNotRegexpMatches(excuses, re)
def test_runs(self): def test_runs(self):
# `Britney` runs and considers packages for boottesting when # `Britney` runs and considers binary packages for boottesting
# it is enabled in the configuration and 'in progress' tests # when it is enabled in the configuration, only binaries needed
# blocks package promotion. # in the phone image are considered for boottesting.
context = [] # 'in progress' tests blocks package promotion.
context.append( context = [
('green', {'Version': '1.1~beta', 'Depends': 'libc6 (>= 0.9)'})) ('green', {'Source': 'green', 'Version': '1.1~beta',
'Depends': 'libc6 (>= 0.9)'}),
('libgreen1', {'Source': 'green', 'Version': '1.1~beta',
'Depends': 'libc6 (>= 0.9)'}),
]
self.do_test( self.do_test(
context, context,
['<li>boottest for green 1.1~beta: IN PROGRESS', [r'\bgreen\b.*>1</a> to .*>1.1~beta<',
'<li>boottest for green 1.1~beta: IN PROGRESS',
'<li>boottest for libgreen1 1.1~beta: SKIPPED',
'<li>Not considered']) '<li>Not considered'])
def test_pass(self): def test_pass(self):
@ -125,10 +131,11 @@ class TestBoottestEnd2End(TestBase):
# promotion. # promotion.
context = [] context = []
context.append( context.append(
('pyqt5', {'Version': '1.1~beta'})) ('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.1~beta'}))
self.do_test( self.do_test(
context, context,
['<li>boottest for pyqt5 1.1~beta: PASS', [r'\bpyqt5-src\b.*\(- to .*>1.1~beta<',
'<li>boottest for pyqt5 1.1~beta: PASS',
'<li>Valid candidate']) '<li>Valid candidate'])
def test_fail(self): def test_fail(self):
@ -137,10 +144,11 @@ class TestBoottestEnd2End(TestBase):
# ('Not considered.') # ('Not considered.')
context = [] context = []
context.append( context.append(
('pyqt5', {'Version': '1.1'})) ('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.1'}))
self.do_test( self.do_test(
context, context,
['<li>boottest for pyqt5 1.1: FAIL', [r'\bpyqt5-src\b.*\(- to .*>1.1<',
'<li>boottest for pyqt5 1.1: FAIL',
'<li>Not considered']) '<li>Not considered'])
def test_skipped(self): def test_skipped(self):
@ -149,10 +157,12 @@ class TestBoottestEnd2End(TestBase):
# promotion. # promotion.
context = [] context = []
context.append( context.append(
('apache2', {'Version': '2.4.8-1ubuntu1'})) ('apache2', {'Source': 'apache2-src',
'Version': '2.4.8-1ubuntu1'}))
self.do_test( self.do_test(
context, context,
['<li>boottest for apache2 2.4.8-1ubuntu1: SKIPPED', [r'\bapache2-src\b.*\(- to .*>2.4.8-1ubuntu1<',
'<li>boottest for apache2 2.4.8-1ubuntu1: SKIPPED',
'<li>Valid candidate']) '<li>Valid candidate'])

Loading…
Cancel
Save