switch autopkgtest policy to detailed excuse info

ubuntu/rebased
Ivo De Decker 5 years ago
parent 8c44a78948
commit 48801054a2

@ -335,17 +335,18 @@ class AutopkgtestPolicy(BasePolicy):
verdict = PolicyVerdict.PASS verdict = PolicyVerdict.PASS
elegible_for_bounty = False elegible_for_bounty = False
source_name = item.package source_name = item.package
results_info = []
# skip/delay autopkgtests until new package is built somewhere # skip/delay autopkgtests until new package is built somewhere
if not source_data_srcdist.binaries: if not source_data_srcdist.binaries:
self.logger.info('%s hasn''t been built anywhere, skipping autopkgtest policy', excuse.name) self.logger.info('%s hasn''t been built anywhere, skipping autopkgtest policy', excuse.name)
excuse.addhtml("nothing built yet, autopkgtest delayed")
verdict = PolicyVerdict.REJECTED_TEMPORARILY verdict = PolicyVerdict.REJECTED_TEMPORARILY
excuse.add_verdict_info(verdict, "nothing built yet, autopkgtest delayed")
if 'all' in excuse.missing_builds: if 'all' in excuse.missing_builds:
self.logger.info('%s hasn''t been built for arch:all, skipping autopkgtest policy', source_name) self.logger.info('%s hasn''t been built for arch:all, skipping autopkgtest policy', source_name)
excuse.addhtml("arch:all not built yet, autopkgtest delayed")
verdict = PolicyVerdict.REJECTED_TEMPORARILY verdict = PolicyVerdict.REJECTED_TEMPORARILY
excuse.add_verdict_info(verdict, "arch:all not built yet, autopkgtest delayed")
if verdict == PolicyVerdict.PASS: if verdict == PolicyVerdict.PASS:
self.logger.debug('Checking autopkgtests for %s', source_name) self.logger.debug('Checking autopkgtests for %s', source_name)
@ -360,11 +361,11 @@ class AutopkgtestPolicy(BasePolicy):
if arch in excuse.missing_builds: if arch in excuse.missing_builds:
verdict = PolicyVerdict.REJECTED_TEMPORARILY verdict = PolicyVerdict.REJECTED_TEMPORARILY
self.logger.info('%s hasn''t been built on arch %s, delay autopkgtest there', source_name, arch) self.logger.info('%s hasn''t been built on arch %s, delay autopkgtest there', source_name, arch)
excuse.addhtml("arch:%s not built yet, autopkgtest delayed there" % arch) excuse.add_verdict_info(verdict, "arch:%s not built yet, autopkgtest delayed there" % arch)
elif arch in excuse.unsatisfiable_on_archs: elif arch in excuse.unsatisfiable_on_archs:
verdict = PolicyVerdict.REJECTED_TEMPORARILY verdict = PolicyVerdict.REJECTED_TEMPORARILY
self.logger.info('%s is uninstallable on arch %s, delay autopkgtest there', source_name, arch) self.logger.info('%s is uninstallable on arch %s, delay autopkgtest there', source_name, arch)
excuse.addhtml("uninstallable on arch %s, autopkgtest delayed there" % arch) excuse.add_verdict_info(verdict, "uninstallable on arch %s, autopkgtest delayed there" % arch)
else: else:
self.request_tests_for_source(item, arch, source_data_srcdist, pkg_arch_result) self.request_tests_for_source(item, arch, source_data_srcdist, pkg_arch_result)
@ -433,14 +434,14 @@ class AutopkgtestPolicy(BasePolicy):
# render HTML line for testsrc entry, but only when action is # render HTML line for testsrc entry, but only when action is
# or may be required # or may be required
if r - {'PASS', 'NEUTRAL', 'RUNNING-ALWAYSFAIL', 'ALWAYSFAIL'}: if r - {'PASS', 'NEUTRAL', 'RUNNING-ALWAYSFAIL', 'ALWAYSFAIL'}:
excuse.addhtml("autopkgtest for %s: %s" % (testname, ', '.join(html_archmsg))) results_info.append("autopkgtest for %s: %s" % (testname, ', '.join(html_archmsg)))
if verdict != PolicyVerdict.PASS: if verdict != PolicyVerdict.PASS:
# check for force-skiptest hint # check for force-skiptest hint
hints = self.hints.search('force-skiptest', package=source_name, version=source_data_srcdist.version) hints = self.hints.search('force-skiptest', package=source_name, version=source_data_srcdist.version)
if hints: if hints:
excuse.addreason('skiptest') excuse.addreason('skiptest')
excuse.addhtml("Should wait for tests relating to %s %s, but forced by %s" % excuse.addinfo("Should wait for tests relating to %s %s, but forced by %s" %
(source_name, source_data_srcdist.version, hints[0].user)) (source_name, source_data_srcdist.version, hints[0].user))
verdict = PolicyVerdict.PASS_HINTED verdict = PolicyVerdict.PASS_HINTED
else: else:
@ -453,6 +454,11 @@ class AutopkgtestPolicy(BasePolicy):
excuse.add_penalty('autopkgtest', int(self.options.adt_regression_penalty)) excuse.add_penalty('autopkgtest', int(self.options.adt_regression_penalty))
# In case we give penalties instead of blocking, we must always pass # In case we give penalties instead of blocking, we must always pass
verdict = PolicyVerdict.PASS verdict = PolicyVerdict.PASS
for i in results_info:
if verdict.is_rejected:
excuse.add_verdict_info(verdict, i)
else:
excuse.addinfo(i)
return verdict return verdict

Loading…
Cancel
Save