Plug in the new autopkgtest policy

ubuntu/rebased
Paul Gevers 7 years ago
parent 4dda7b6e7e
commit 77bb15e0e8
No known key found for this signature in database
GPG Key ID: 9C5C99EB05BD750A

@ -79,3 +79,13 @@ HINTS_AUTO-REMOVALS = remove
SMOOTH_UPDATES = libs oldlibs
IGNORE_CRUFT = 1
ADT_ENABLE = yes
ADT_ARCHES = amd64 i386
ADT_AMQP = file://output/debci.input
# space separate list of PPAs to add for test requests and for polling results;
# the *last* one determines the swift container name
ADT_PPAS =
# set this to the path of a (r/o) results.cache for running many parallel
# britney instances for PPAs without updating the cache
ADT_SHARED_RESULTS_CACHE =

@ -198,6 +198,7 @@ from britney2.hints import HintParser
from britney2.installability.builder import build_installability_tester
from britney2.migrationitem import MigrationItem
from britney2.policies.policy import AgePolicy, RCBugPolicy, PiupartsPolicy, PolicyVerdict
from britney2.policies.autopkgtest import AutopkgtestPolicy
from britney2.utils import (old_libraries_format, undo_changes,
compute_reverse_tree, possibly_compressed,
read_nuninst, write_nuninst, write_heidi,
@ -294,6 +295,14 @@ class Britney(object):
self.binaries['tpu'] = {}
self.binaries['pu'] = {}
# compute inverse Testsuite-Triggers: map, unifying all series
self.log('Building inverse testsuite_triggers map')
self.testsuite_triggers = {}
for suitemap in self.sources.values():
for src, data in suitemap.items():
for trigger in data.testsuite_triggers:
self.testsuite_triggers.setdefault(trigger, set()).add(src)
self.binaries['unstable'] = self.read_binaries(self.suite_info['unstable'].path, "unstable", self.options.architectures)
for suite in ('tpu', 'pu'):
if suite in self.suite_info:
@ -512,6 +521,8 @@ class Britney(object):
self.policies.append(AgePolicy(self.options, self.suite_info, MINDAYS))
self.policies.append(RCBugPolicy(self.options, self.suite_info))
self.policies.append(PiupartsPolicy(self.options, self.suite_info))
if getattr(self.options, 'adt_enable') == 'yes':
self.policies.append(AutopkgtestPolicy(self.options, self.suite_info))
for policy in self.policies:
policy.register_hints(self._hint_parser)
@ -569,6 +580,8 @@ class Britney(object):
[],
None,
True,
[],
[],
)
self.sources['testing'][pkg_name] = src_data
@ -643,6 +656,8 @@ class Britney(object):
[],
None,
True,
[],
[],
)
self.sources['testing'][pkg_name] = src_data
self.sources['unstable'][pkg_name] = src_data
@ -844,7 +859,7 @@ class Britney(object):
srcdist[source].binaries.append(pkg_id)
# if the source package doesn't exist, create a fake one
else:
srcdist[source] = SourcePackage(source_version, 'faux', [pkg_id], None, True)
srcdist[source] = SourcePackage(source_version, 'faux', [pkg_id], None, True, [], [])
# add the resulting dictionary to the package list
packages[pkg] = dpkg

@ -9,14 +9,16 @@ SuiteInfo = namedtuple('SuiteInfo', [
class SourcePackage(object):
__slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc']
__slots__ = ['version', 'section', 'binaries', 'maintainer', 'is_fakesrc', 'testsuite', 'testsuite_triggers']
def __init__(self, version, section, binaries, maintainer, is_fakesrc):
def __init__(self, version, section, binaries, maintainer, is_fakesrc, testsuite, testsuite_triggers):
self.version = version
self.section = section
self.binaries = binaries
self.maintainer = maintainer
self.is_fakesrc = is_fakesrc
self.testsuite = testsuite
self.testsuite_triggers = testsuite_triggers
def __getitem__(self, item):
return getattr(self, self.__slots__[item])

@ -726,6 +726,8 @@ def read_sources_file(filename, sources=None, intern=sys.intern):
[],
maint,
False,
get_field('Testsuite', '').split(),
get_field('Testsuite-Triggers', '').replace(',', '').split(),
)
return sources

Loading…
Cancel
Save