diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 6955b32..bbb53d2 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -203,6 +203,7 @@ class AutopkgtestPolicy(BasePolicy): # add test result details to Excuse verdict = PolicyVerdict.PASS + src_has_own_test = False cloud_url = self.options.adt_ci_url + "packages/%(h)s/%(s)s/%(r)s/%(a)s" for (testsrc, testver) in sorted(pkg_arch_result): arch_results = pkg_arch_result[(testsrc, testver)] @@ -215,6 +216,11 @@ class AutopkgtestPolicy(BasePolicy): if not r - {'RUNNING', 'RUNNING-ALWAYSFAIL'}: testver = None + # Keep track if this source package has tests of its own for the + # bounty system + if testsrc == source_name: + src_has_own_test = True + html_archmsg = [] for arch in sorted(arch_results): (status, log_url) = arch_results[arch] @@ -271,7 +277,7 @@ class AutopkgtestPolicy(BasePolicy): else: excuse.addreason('autopkgtest') - if self.options.adt_success_bounty and verdict == PolicyVerdict.PASS: + if self.options.adt_success_bounty and verdict == PolicyVerdict.PASS and src_has_own_test: excuse.add_bounty('autopkgtest', int(self.options.adt_success_bounty)) if self.options.adt_regression_penalty and verdict == PolicyVerdict.REJECTED_PERMANENTLY: excuse.add_penalty('autopkgtest', int(self.options.adt_regression_penalty))