Request boottests for sources, not binaries. Jenkins glue will drive adt properly.

This commit is contained in:
Celso Providelo 2015-02-03 12:27:22 -05:00
parent 49f0a5b3ff
commit 06ea2ab941
3 changed files with 49 additions and 56 deletions

View File

@ -92,8 +92,8 @@ class BootTestJenkinsJob(object):
Wraps 'boottest/jenkins/boottest-britney' script for: Wraps 'boottest/jenkins/boottest-britney' script for:
* 'check' existing boottest job status ('check <binary> <version>') * 'check' existing boottest job status ('check <source> <version>')
* 'submit' new boottest jobs ('submit <binary> <version>') * 'submit' new boottest jobs ('submit <source> <version>')
""" """
@ -155,32 +155,36 @@ class BootTest(object):
self.dispatcher = BootTestJenkinsJob(self.distribution, self.series) self.dispatcher = BootTestJenkinsJob(self.distribution, self.series)
def update(self, excuse): def update(self, excuse):
"""Update given 'excuse' and yields testing status. """Return the boottest status for the given excuse.
Yields (status, binary_name) for each binary considered for the A new boottest job will be requested if the the source was not
given excuse. See `BootTestJenkinsJob.get_status`. yet processed, otherwise the status of the corresponding job will
be returned.
Binaries are considered for boottesting if they are part of the Sources are only considered for boottesting if they produce binaries
phone image manifest. See `TouchManifest`. that are part of the phone image manifest. See `TouchManifest`.
""" """
# Discover all binaries for the 'excused' source. # Discover all binaries for the 'excused' source.
unstable_sources = self.britney.sources['unstable'] unstable_sources = self.britney.sources['unstable']
# Dismiss if source is not yet recognized (??). # Dismiss if source is not yet recognized (??).
if excuse.name not in unstable_sources: if excuse.name not in unstable_sources:
raise StopIteration return None
# Binaries are a seq of "<binname>/<arch>" and, practically, boottest # Binaries are a seq of "<binname>/<arch>" and, practically, boottest
# is only concerned about armhf+all binaries. # is only concerned about armhf binaries mentioned in the phone
# Anything else should be skipped. # manifest. Anything else should be skipped.
binary_names = [ phone_binaries = [
b.split('/')[0] b for b in unstable_sources[excuse.name][BINARIES]
for b in unstable_sources[excuse.name][BINARIES]
if b.split('/')[1] in self.britney.options.boottest_arches.split() if b.split('/')[1] in self.britney.options.boottest_arches.split()
and b.split('/')[0] in self.phone_manifest
] ]
# Process (request or update) boottest attempts for each binary. # Process (request or update) a boottest attempt for the source
for name in binary_names: # if one or more of its binaries are part of the phone image.
if name in self.phone_manifest: if phone_binaries:
status = self.dispatcher.get_status(name, excuse.ver[1]) status = self.dispatcher.get_status(excuse.name, excuse.ver[1])
else: else:
status = 'SKIPPED' status = 'SKIPPED'
yield name, status
return status

View File

@ -1919,36 +1919,26 @@ class Britney(object):
"_" in excuse.name or "_" in excuse.name or
excuse.ver[1] == "-"): excuse.ver[1] == "-"):
continue continue
statuses = set()
# Update valid excuses from the boottest context. # Update valid excuses from the boottest context.
for binary_name, status in boottest.update(excuse): status = boottest.update(excuse)
label = BootTest.EXCUSE_LABELS.get( label = BootTest.EXCUSE_LABELS.get(status, 'UNKNOWN STATUS')
status, 'UNKNOWN STATUS') excuse.addhtml("Boottest result: %s" % (label))
excuse.addhtml("boottest for %s %s: %s" % # Allows hints to force boottest failures/attempts
(binary_name, excuse.ver[1], label)) # to be ignored.
# Allows hints to force boottest failures/attempts hints = self.hints.search('force', package=excuse.name)
# to be ignored. hints.extend(
hints = self.hints.search('force', package=excuse.name) self.hints.search('force-skiptest', package=excuse.name))
hints.extend( forces = [x for x in hints
self.hints.search( if same_source(excuse.ver[1], x.version)]
'force-skiptest', package=excuse.name)) if forces:
forces = [ excuse.addhtml(
x for x in hints "Should wait for %s %s boottest, but forced by "
if same_source(excuse.ver[1], x.version)] "%s" % (excuse.name, excuse.ver[1],
if forces: forces[0].user))
excuse.addhtml(
"Should wait for %s %s boottest, but forced by "
"%s" % (binary_name, excuse.ver[1],
forces[0].user))
status = 'PASS'
statuses.add(status)
# No boottest attempts requested, it's not relevant in this
# context, rely on other checks to judge promotion.
if not statuses:
continue continue
# Block promotion if any boottests attempt has failed or # Block promotion if any boottests attempt has failed or
# still in progress. # still in progress.
if not statuses.issubset(set(BootTest.VALID_STATUSES)): if status not in BootTest.VALID_STATUSES:
excuse.addhtml("Not considered") excuse.addhtml("Not considered")
excuse.addreason("boottest") excuse.addreason("boottest")
excuse.is_valid = False excuse.is_valid = False

View File

@ -172,7 +172,7 @@ def submit():
print 'RUNNING' print 'RUNNING'
def check(): def check():
if args.name != 'pyqt5': if args.name != 'pyqt5-src':
sys.exit(100) sys.exit(100)
if args.version == '1.1~beta': if args.version == '1.1~beta':
print 'PASS' print 'PASS'
@ -226,10 +226,8 @@ args.func()
self.do_test( self.do_test(
context, context,
[r'\bgreen\b.*>1</a> to .*>1.1~beta<', [r'\bgreen\b.*>1</a> to .*>1.1~beta<',
'<li>boottest for green 1.1~beta: {}'.format( '<li>Boottest result: {}'.format(
BootTest.EXCUSE_LABELS['RUNNING']), BootTest.EXCUSE_LABELS['RUNNING']),
'<li>boottest for libgreen1 1.1~beta: {}'.format(
BootTest.EXCUSE_LABELS['SKIPPED']),
'<li>Not considered']) '<li>Not considered'])
def test_pass(self): def test_pass(self):
@ -243,7 +241,7 @@ args.func()
self.do_test( self.do_test(
context, context,
[r'\bpyqt5-src\b.*\(- to .*>1.1~beta<', [r'\bpyqt5-src\b.*\(- to .*>1.1~beta<',
'<li>boottest for pyqt5 1.1~beta: {}'.format( '<li>Boottest result: {}'.format(
BootTest.EXCUSE_LABELS['PASS']), BootTest.EXCUSE_LABELS['PASS']),
'<li>Valid candidate']) '<li>Valid candidate'])
@ -258,7 +256,7 @@ args.func()
self.do_test( self.do_test(
context, context,
[r'\bpyqt5-src\b.*\(- to .*>1.1<', [r'\bpyqt5-src\b.*\(- to .*>1.1<',
'<li>boottest for pyqt5 1.1: {}'.format( '<li>Boottest result: {}'.format(
BootTest.EXCUSE_LABELS['FAIL']), BootTest.EXCUSE_LABELS['FAIL']),
'<li>Not considered']) '<li>Not considered'])
@ -283,9 +281,10 @@ args.func()
self.do_test( self.do_test(
context, context,
[r'\bpyqt5-src\b.*\(- to .*>1.1<', [r'\bpyqt5-src\b.*\(- to .*>1.1<',
'<li>boottest for pyqt5 1.1: {}'.format( '<li>Boottest result: {}'.format(
BootTest.EXCUSE_LABELS['FAIL']), BootTest.EXCUSE_LABELS['FAIL']),
'<li>Should wait for pyqt5 1.1 boottest, but forced by cjwatson', '<li>Should wait for pyqt5-src 1.1 boottest, '
'but forced by cjwatson',
'<li>Valid candidate']) '<li>Valid candidate'])
def test_fail_but_skipped_by_hints(self): def test_fail_but_skipped_by_hints(self):
@ -298,7 +297,7 @@ args.func()
self.do_test( self.do_test(
context, context,
[r'\bgreen\b.*>1</a> to .*>1.1~beta<', [r'\bgreen\b.*>1</a> to .*>1.1~beta<',
'<li>boottest for green 1.1~beta: {}'.format( '<li>Boottest result: {}'.format(
BootTest.EXCUSE_LABELS['RUNNING']), BootTest.EXCUSE_LABELS['RUNNING']),
'<li>Should wait for green 1.1~beta boottest, but forced ' '<li>Should wait for green 1.1~beta boottest, but forced '
'by cjwatson', 'by cjwatson',
@ -315,7 +314,7 @@ args.func()
self.do_test( self.do_test(
context, context,
[r'\bapache2-src\b.*\(- to .*>2.4.8-1ubuntu1<', [r'\bapache2-src\b.*\(- to .*>2.4.8-1ubuntu1<',
'<li>boottest for apache2 2.4.8-1ubuntu1: {}'.format( '<li>Boottest result: {}'.format(
BootTest.EXCUSE_LABELS['SKIPPED']), BootTest.EXCUSE_LABELS['SKIPPED']),
'<li>Valid candidate']) '<li>Valid candidate'])