summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Lane <iain.lane@canonical.com>2017-03-02 10:27:34 (GMT)
committerIain Lane <iain.lane@canonical.com>2017-03-02 10:28:22 (GMT)
commitfe627aaa1593a3e5e4de253a498e87ac7d083401 (patch)
treeb6497655abfb8f8175d0729215d3db602bbed807
parentd366288a7bc5d0df93b00b1654af129ae0ca23eb (diff)
autopkgtest: Don't request tests for new packages that FTBFS
These are treated separately by britney ('no-binaries' vs. 'missing-builds').
-rw-r--r--britney2/policies/autopkgtest.py3
-rwxr-xr-xtests/test_autopkgtest.py19
2 files changed, 21 insertions, 1 deletions
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'''