mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-10 05:57:28 +00:00
merge lp:~jibel/britney/do_not_test_untestable_packages
This commit is contained in:
commit
35ea6a7c61
@ -128,7 +128,10 @@ class AutoPackageTest(object):
|
||||
command.extend(args)
|
||||
subprocess.check_call(command)
|
||||
|
||||
def request(self, packages):
|
||||
def request(self, packages, excludes=None):
|
||||
if excludes is None:
|
||||
excludes = []
|
||||
|
||||
self._ensure_rc_file()
|
||||
request_path = self._request_path
|
||||
if os.path.exists(request_path):
|
||||
@ -140,6 +143,22 @@ class AutoPackageTest(object):
|
||||
print("%s %s" % (src, ver), file=request_file)
|
||||
request_file.flush()
|
||||
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):
|
||||
# Make sure that there's an entry in pkgcauses for each new
|
||||
# request, so that results() gives useful information without
|
||||
|
@ -1684,8 +1684,10 @@ class Britney(object):
|
||||
self, self.options.adt_series, debug=adt_debug)
|
||||
autopkgtest_packages = []
|
||||
autopkgtest_excuses = []
|
||||
autopkgtest_excludes = []
|
||||
for e in self.excuses:
|
||||
if not e.run_autopkgtest:
|
||||
autopkgtest_excludes.append(e.name)
|
||||
continue
|
||||
# skip removals, binary-only candidates, and proposed-updates
|
||||
if e.name.startswith("-") or "/" in e.name or "_" in e.name:
|
||||
@ -1694,7 +1696,7 @@ class Britney(object):
|
||||
continue
|
||||
autopkgtest_excuses.append(e)
|
||||
autopkgtest_packages.append((e.name, e.ver[1]))
|
||||
autopkgtest.request(autopkgtest_packages)
|
||||
autopkgtest.request(autopkgtest_packages, autopkgtest_excludes)
|
||||
if not self.options.dry_run:
|
||||
autopkgtest.submit()
|
||||
autopkgtest.collect()
|
||||
|
Loading…
x
Reference in New Issue
Block a user