Move i386 functionality later in the code and add more verbose logging

Still trying to figure out this new functionality. We're getting close
with more logging, so I have added a little bit more logging, and
stopped using what was presumably a lit of all binaries for i386, and
now am using what is hopefully just the list of binaries for the source
package
master
Tim Andersson 5 months ago
parent 2f6b76f0b5
commit e6db31c010
No known key found for this signature in database
GPG Key ID: 50AF67504D9E703D

@ -700,29 +700,6 @@ class AutopkgtestPolicy(BasePolicy):
reported_pkgs = set() reported_pkgs = set()
tests = [] tests = []
# We don't want to run tests for src packages on i386 if all of the binary packages
# have Architecture: all. These are redundant for real world use cases as these deps
# are satisfied by amd64 binaries
try:
if arch == "i386":
all_binaries_arch_all = True
for package_name in binaries_info.keys():
bin_arch = binaries_info[package_name].architecture or 'all'
self.logger.info('Binary has arch %s for binary %s', bin_arch, package_name)
if bin_arch != 'all':
all_binaries_arch_all = False
break
if all_binaries_arch_all:
self.logger.info('Source package %s has binaries which are all Architecture: all, and tests have been requested on %s, not running any tests for this src package',
src,
arch)
return []
else:
self.logger.info('Source package %s has binaries which are NOT Architecture: all, and tests have been requested on %s, running tests for this package',
src,
arch)
except Exception:
self.logger.error('i386 useless autopkgtest check failed with: %s', traceback.format_exc())
# gcc-N triggers tons of tests via libgcc1, but this is mostly in vain: # gcc-N triggers tons of tests via libgcc1, but this is mostly in vain:
# gcc already tests itself during build, and it is being used from # gcc already tests itself during build, and it is being used from
@ -768,6 +745,37 @@ class AutopkgtestPolicy(BasePolicy):
# we want to test the package itself, if it still has a test in unstable # we want to test the package itself, if it still has a test in unstable
# but only if the package actually exists on this arch # but only if the package actually exists on this arch
srcinfo = source_suite.sources[src] srcinfo = source_suite.sources[src]
# We don't want to run tests for src packages on i386 if all of the binary packages
# have Architecture: all. These are redundant for real world use cases as these deps
# are satisfied by amd64 binaries
try:
if arch == "i386":
all_binaries_arch_all = True
for pkg_id in srcinfo.binaries:
self.logger.info('Binary %s has arch %s for source package %s',
pkg_id.package_name,
pkg_id.architecture,
src,
)
self.logger.info('binaries_info reports arch as %s for binary package %s',
binaries_info[pkg_id.package_name].architecture,
pkg_id.package_name,
)
if pkg_id.architecture != 'all':
all_binaries_arch_all = False
break
if all_binaries_arch_all:
self.logger.info('Source package %s has binaries which are all Architecture: all, and tests have been requested on %s, not running any tests for this src package',
src,
arch)
return []
else:
self.logger.info('Source package %s has binaries which are NOT Architecture: all, and tests have been requested on %s, running tests for this package',
src,
arch)
except Exception:
self.logger.error('i386 useless autopkgtest check failed with: %s', traceback.format_exc())
if ('autopkgtest' in srcinfo.testsuite or self.has_autodep8(srcinfo, binaries_info)) and \ if ('autopkgtest' in srcinfo.testsuite or self.has_autodep8(srcinfo, binaries_info)) and \
len(excuse.packages[arch]) > 0: len(excuse.packages[arch]) > 0:
reported_pkgs.add(src) reported_pkgs.add(src)

Loading…
Cancel
Save