* Remove packages from the request file that are not valid for testing i.e excuse.run_autopkgtest = False.

bzr-import-20160707
Jean-Baptiste Lallement 11 years ago
parent 44782c8e37
commit 7615eb8d3f

@ -128,7 +128,10 @@ class AutoPackageTest(object):
command.extend(args) command.extend(args)
subprocess.check_call(command) subprocess.check_call(command)
def request(self, packages): def request(self, packages, excludes=None):
if excludes is None:
excludes = []
self._ensure_rc_file() self._ensure_rc_file()
request_path = self._request_path request_path = self._request_path
if os.path.exists(request_path): if os.path.exists(request_path):
@ -140,6 +143,22 @@ class AutoPackageTest(object):
print("%s %s" % (src, ver), file=request_file) print("%s %s" % (src, ver), file=request_file)
request_file.flush() request_file.flush()
self._adt_britney("request", "-O", request_path, request_file.name) self._adt_britney("request", "-O", request_path, request_file.name)
# Remove packages that have been identified as invalid candidates for
# testing from the request file i.e run_autopkgtest = False
with open(request_path, 'r') as request_file:
lines = request_file.readlines()
with open(request_path, 'w') as request_file:
for line in lines:
src = line.split()[0]
if not src in excludes:
request_file.write(line)
else:
if self.britney.options.verbose:
print("I: [%s] - Requested autopkgtest for %s but "
"run_autopkgtest set to False" %
(time.asctime(), src))
for linebits in self._parse(request_path): for linebits in self._parse(request_path):
# Make sure that there's an entry in pkgcauses for each new # Make sure that there's an entry in pkgcauses for each new
# request, so that results() gives useful information without # request, so that results() gives useful information without

@ -1684,8 +1684,10 @@ class Britney(object):
self, self.options.adt_series, debug=adt_debug) self, self.options.adt_series, debug=adt_debug)
autopkgtest_packages = [] autopkgtest_packages = []
autopkgtest_excuses = [] autopkgtest_excuses = []
autopkgtest_excludes = []
for e in self.excuses: for e in self.excuses:
if not e.run_autopkgtest: if not e.run_autopkgtest:
autopkgtest_excludes.append(e.name)
continue continue
# skip removals, binary-only candidates, and proposed-updates # skip removals, binary-only candidates, and proposed-updates
if e.name.startswith("-") or "/" in e.name or "_" in e.name: if e.name.startswith("-") or "/" in e.name or "_" in e.name:
@ -1694,7 +1696,7 @@ class Britney(object):
continue continue
autopkgtest_excuses.append(e) autopkgtest_excuses.append(e)
autopkgtest_packages.append((e.name, e.ver[1])) autopkgtest_packages.append((e.name, e.ver[1]))
autopkgtest.request(autopkgtest_packages) autopkgtest.request(autopkgtest_packages, autopkgtest_excludes)
if not self.options.dry_run: if not self.options.dry_run:
autopkgtest.submit() autopkgtest.submit()
autopkgtest.collect() autopkgtest.collect()

Loading…
Cancel
Save