Merge ~vorlon/britney/+git/britney2-ubuntu:autopkgtest-dry-run into ~ubuntu-release/britney/+git/britney2-ubuntu:master

Proposed by Steve Langasek
Status: Merged
Merged at revision: e5247de7b870c20611475b43ee8baf5934043b7b
Proposed branch: ~vorlon/britney/+git/britney2-ubuntu:autopkgtest-dry-run
Merge into: ~ubuntu-release/britney/+git/britney2-ubuntu:master
Diff against target: 56 lines (+8/-5)
2 files modified
britney.py (+3/-2)
britney2/policies/autopkgtest.py (+5/-3)
Reviewer Review Type Date Requested Status
Brian Murray Approve
Utkarsh Gupta Approve
Review via email: mp+438406@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

"Looks" good. :)

review: Approve
Revision history for this message
Brian Murray (brian-murray) wrote :

I've one in line comment which would be nice to address.

review: Approve
Revision history for this message
Steve Langasek (vorlon) wrote :

thanks. fixed the whitespace, merging now

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/britney.py b/britney.py
2index b5deff2..0f45ff2 100755
3--- a/britney.py
4+++ b/britney.py
5@@ -521,8 +521,9 @@ class Britney(object):
6 self._policy_engine.add_policy(RCBugPolicy(self.options, self.suite_info))
7 if getattr(self.options, 'piuparts_enable', 'yes') == 'yes':
8 self._policy_engine.add_policy(PiupartsPolicy(self.options, self.suite_info))
9- if getattr(self.options, 'adt_enable') == 'yes':
10- self._policy_engine.add_policy(AutopkgtestPolicy(self.options, self.suite_info))
11+ add_autopkgtest_policy = getattr(self.options, 'adt_enable', 'no')
12+ if add_autopkgtest_policy in ('yes', 'dry-run'):
13+ self._policy_engine.add_policy(AutopkgtestPolicy(self.options, self.suite_info, dry_run=add_autopkgtest_policy))
14 self._policy_engine.add_policy(AgePolicy(self.options, self.suite_info, MINDAYS))
15 # XXX this policy results in asymmetric enforcement of
16 # build-dependencies in the release pocket (nothing blocks
17diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py
18index 7ff8c1f..546a03c 100644
19--- a/britney2/policies/autopkgtest.py
20+++ b/britney2/policies/autopkgtest.py
21@@ -117,7 +117,8 @@ class AutopkgtestPolicy(BasePolicy):
22 reject the upload if any of those regress.
23 """
24
25- def __init__(self, options, suite_info):
26+ def __init__(self, options, suite_info, dry_run=False):
27+
28 super().__init__('autopkgtest', options, suite_info, {SuiteClass.PRIMARY_SOURCE_SUITE})
29 # tests requested in this and previous runs
30 # trigger -> src -> [arch]
31@@ -126,6 +127,7 @@ class AutopkgtestPolicy(BasePolicy):
32 self.testsuite_triggers = {}
33 self.result_in_baseline_cache = collections.defaultdict(dict)
34 self.database_path = os.path.join(self.state_dir, 'autopkgtest.db')
35+ self.dry_run = dry_run
36
37 # results map: trigger -> src -> arch -> [passed, version, run_id, seen]
38 # - trigger is "source/version" of an unstable package that triggered
39@@ -292,7 +294,7 @@ class AutopkgtestPolicy(BasePolicy):
40 # Initialize AMQP connection
41 self.amqp_channel = None
42 self.amqp_file = None
43- if self.options.dry_run:
44+ if self.options.dry_run or self.dry_run:
45 return
46
47 amqp_url = self.options.adt_amqp
48@@ -1117,7 +1119,7 @@ class AutopkgtestPolicy(BasePolicy):
49 If huge is true, then the request will be put into the -huge instead of
50 normal queue.
51 '''
52- if self.options.dry_run:
53+ if self.options.dry_run or self.dry_run:
54 return
55
56 params = {'triggers': triggers}

Subscribers

People subscribed via source and target branches