diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py index 9e3dcb9..fac6860 100644 --- a/britney2/policies/autopkgtest.py +++ b/britney2/policies/autopkgtest.py @@ -161,7 +161,8 @@ class AutopkgtestPolicy(BasePolicy): def apply_policy_impl(self, tests_info, suite, source_name, source_data_tdist, source_data_srcdist, excuse): # skip/delay autopkgtests until package is built - if excuse.missing_builds or 'depends' in excuse.reason: + binaries_info = self.britney.sources[suite][source_name] + if excuse.missing_builds or not binaries_info.binaries or 'depends' in excuse.reason: self.log('%s has missing builds or is uninstallable, skipping autopkgtest policy' % excuse.name) return PolicyVerdict.REJECTED_TEMPORARILY diff --git a/tests/test_autopkgtest.py b/tests/test_autopkgtest.py index 165cfec..b93b84d 100755 --- a/tests/test_autopkgtest.py +++ b/tests/test_autopkgtest.py @@ -665,6 +665,25 @@ class T(TestBase): self.assertEqual(self.amqp_requests, set()) self.assertEqual(self.pending_requests, {}) + def test_unbuilt_not_in_testing(self): + '''Unbuilt package should not trigger tests or get considered (package not in testing)''' + + self.sourceppa_cache['lime'] = {'1': ''} + + self.data.add_src('lime', True, {'Version': '1', 'Testsuite': 'autopkgtest'}) + exc = self.do_test( + # unbuilt unstable version + [], + {'lime': (False, {})}, + {'lime': [('old-version', '-'), ('new-version', '1'), + ('reason', 'no-binaries'), + ] + })[1] + # autopkgtest should not be triggered for unbuilt pkg + self.assertEqual(exc['lime']['policy_info']['autopkgtest'], {}) + self.assertEqual(self.amqp_requests, set()) + self.assertEqual(self.pending_requests, {}) + def test_partial_unbuilt(self): '''Unbuilt package on some arches should not trigger tests'''