mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-10 05:57:28 +00:00
Silently skipping boottesting for sources not yet built on the allowed architectures (all and armhf).
This commit is contained in:
parent
ed31f1129b
commit
eeaf8e3deb
10
boottest.py
10
boottest.py
@ -75,6 +75,8 @@ class BootTest(object):
|
||||
"RUNNING": '<span style="background:#99ddff">Test in progress</span>',
|
||||
}
|
||||
|
||||
ARCHITECTURES = ('all', 'armhf')
|
||||
|
||||
def __init__(self, britney, distribution, series, debug=False):
|
||||
self.britney = britney
|
||||
self.distribution = distribution
|
||||
@ -107,12 +109,16 @@ class BootTest(object):
|
||||
"""
|
||||
# Discover all binaries for the 'excused' source.
|
||||
unstable_sources = self.britney.sources['unstable']
|
||||
# Dismiss if source is not yet recognized (??).
|
||||
if excuse.name not in unstable_sources:
|
||||
raise StopIteration
|
||||
# XXX cprov 20150120: binaries are a seq of "<binname>/<arch>" and,
|
||||
# practically, boottest is only concerned about armhf+all binaries.
|
||||
# Anything else should be skipped.
|
||||
binary_names = [
|
||||
bin.split('/')[0]
|
||||
for bin in unstable_sources[excuse.name][BINARIES]
|
||||
b.split('/')[0]
|
||||
for b in unstable_sources[excuse.name][BINARIES]
|
||||
if b.split('/')[1] in self.ARCHITECTURES
|
||||
]
|
||||
|
||||
# Process (request or update) boottest attempts for each binary.
|
||||
|
19
britney.py
19
britney.py
@ -1897,18 +1897,27 @@ class Britney(object):
|
||||
# Skip already invalid excuses.
|
||||
if not excuse.is_valid:
|
||||
continue
|
||||
# Also skip removals, binary-only candidates, proposed-updates
|
||||
# and unknown versions.
|
||||
if (e.name.startswith("-") or
|
||||
"/" in e.name or
|
||||
"_" in e.name or
|
||||
e.ver[1] == "-"):
|
||||
continue
|
||||
statuses = set()
|
||||
# Update valid excuses from the boottest context and if they
|
||||
# have failed, block their migration.
|
||||
# Update valid excuses from the boottest context.
|
||||
for binary_name, status in boottest.update(excuse):
|
||||
label = BootTest.EXCUSE_LABELS.get(
|
||||
status, 'UNKNOWN STATUS')
|
||||
excuse.addhtml("boottest for %s %s: %s" %
|
||||
(binary_name, excuse.ver[1], label))
|
||||
statuses.add(status)
|
||||
# If all boottests passed or were skipped, the excuse is
|
||||
# clean and promotion can proceed, according to the
|
||||
# boottest criteria. Otherwise block the promotion.
|
||||
# No boottest attemps requested, it's not relevant in this
|
||||
# context, rely on other checks to judge promotion.
|
||||
if not statuses:
|
||||
continue
|
||||
# Block promotion if any boottests attempt has failed or
|
||||
# still in progress.
|
||||
if not statuses.issubset(set(BootTest.VALID_STATUSES)):
|
||||
excuse.addhtml("Not considered")
|
||||
excuse.addreason("boottest")
|
||||
|
@ -76,15 +76,18 @@ class TestBoottestEnd2End(TestBase):
|
||||
super(TestBoottestEnd2End, self).setUp()
|
||||
self.britney_conf = os.path.join(
|
||||
PROJECT_DIR, 'britney_boottest.conf')
|
||||
self.data.add('libc6', False)
|
||||
self.data.add('libc6', False, {'Architecture': 'armhf'}),
|
||||
|
||||
self.data.add(
|
||||
'libgreen1',
|
||||
False,
|
||||
{'Source': 'green', 'Depends': 'libc6 (>= 0.9)'})
|
||||
{'Source': 'green', 'Architecture': 'armhf',
|
||||
'Depends': 'libc6 (>= 0.9)'})
|
||||
self.data.add(
|
||||
'green',
|
||||
False,
|
||||
{'Source': 'green', 'Depends': 'libc6 (>= 0.9), libgreen1'})
|
||||
{'Source': 'green', 'Architecture': 'armhf',
|
||||
'Depends': 'libc6 (>= 0.9), libgreen1'})
|
||||
self.create_manifest([
|
||||
'green 1.0',
|
||||
'pyqt5:armhf 1.0',
|
||||
@ -117,8 +120,9 @@ class TestBoottestEnd2End(TestBase):
|
||||
# 'in progress' tests blocks package promotion.
|
||||
context = [
|
||||
('green', {'Source': 'green', 'Version': '1.1~beta',
|
||||
'Depends': 'libc6 (>= 0.9)'}),
|
||||
'Architecture': 'armhf', 'Depends': 'libc6 (>= 0.9)'}),
|
||||
('libgreen1', {'Source': 'green', 'Version': '1.1~beta',
|
||||
'Architecture': 'armhf',
|
||||
'Depends': 'libc6 (>= 0.9)'}),
|
||||
]
|
||||
self.do_test(
|
||||
@ -136,7 +140,8 @@ class TestBoottestEnd2End(TestBase):
|
||||
# promotion.
|
||||
context = []
|
||||
context.append(
|
||||
('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.1~beta'}))
|
||||
('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.1~beta',
|
||||
'Architecture': 'all'}))
|
||||
self.do_test(
|
||||
context,
|
||||
[r'\bpyqt5-src\b.*\(- to .*>1.1~beta<',
|
||||
@ -150,7 +155,8 @@ class TestBoottestEnd2End(TestBase):
|
||||
# ('Not considered.')
|
||||
context = []
|
||||
context.append(
|
||||
('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.1'}))
|
||||
('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.1',
|
||||
'Architecture': 'all'}))
|
||||
self.do_test(
|
||||
context,
|
||||
[r'\bpyqt5-src\b.*\(- to .*>1.1<',
|
||||
@ -158,13 +164,13 @@ class TestBoottestEnd2End(TestBase):
|
||||
BootTest.EXCUSE_LABELS['FAIL']),
|
||||
'<li>Not considered'])
|
||||
|
||||
def test_skipped(self):
|
||||
def test_skipped_not_on_phone(self):
|
||||
# `Britney` updates boottesting information in excuses when the
|
||||
# package was skipped and marks the package as a valid candidate for
|
||||
# promotion.
|
||||
context = []
|
||||
context.append(
|
||||
('apache2', {'Source': 'apache2-src',
|
||||
('apache2', {'Source': 'apache2-src', 'Architecture': 'all',
|
||||
'Version': '2.4.8-1ubuntu1'}))
|
||||
self.do_test(
|
||||
context,
|
||||
@ -173,6 +179,22 @@ class TestBoottestEnd2End(TestBase):
|
||||
BootTest.EXCUSE_LABELS['SKIPPED']),
|
||||
'<li>Valid candidate'])
|
||||
|
||||
def test_skipped_architecture_not_allowed(self):
|
||||
# `Britney` does not trigger boottests for source not yet built on
|
||||
# the allowed architectures.
|
||||
self.data.add(
|
||||
'pyqt5', False, {'Source': 'pyqt5-src', 'Architecture': 'armhf'})
|
||||
context = [
|
||||
('pyqt5', {'Source': 'pyqt5-src', 'Version': '1.1',
|
||||
'Architecture': 'amd64'}),
|
||||
]
|
||||
self.do_test(
|
||||
context,
|
||||
[r'\bpyqt5-src\b.*>1</a> to .*>1.1<',
|
||||
r'<li>missing build on .*>armhf</a>: pyqt5 \(from .*>1</a>\)',
|
||||
'<li>Not considered'])
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
Loading…
x
Reference in New Issue
Block a user