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
diff --git a/britney.py b/britney.py
index b5deff2..0f45ff2 100755
--- a/britney.py
+++ b/britney.py
@@ -521,8 +521,9 @@ class Britney(object):
521 self._policy_engine.add_policy(RCBugPolicy(self.options, self.suite_info))521 self._policy_engine.add_policy(RCBugPolicy(self.options, self.suite_info))
522 if getattr(self.options, 'piuparts_enable', 'yes') == 'yes':522 if getattr(self.options, 'piuparts_enable', 'yes') == 'yes':
523 self._policy_engine.add_policy(PiupartsPolicy(self.options, self.suite_info))523 self._policy_engine.add_policy(PiupartsPolicy(self.options, self.suite_info))
524 if getattr(self.options, 'adt_enable') == 'yes':524 add_autopkgtest_policy = getattr(self.options, 'adt_enable', 'no')
525 self._policy_engine.add_policy(AutopkgtestPolicy(self.options, self.suite_info))525 if add_autopkgtest_policy in ('yes', 'dry-run'):
526 self._policy_engine.add_policy(AutopkgtestPolicy(self.options, self.suite_info, dry_run=add_autopkgtest_policy))
526 self._policy_engine.add_policy(AgePolicy(self.options, self.suite_info, MINDAYS))527 self._policy_engine.add_policy(AgePolicy(self.options, self.suite_info, MINDAYS))
527 # XXX this policy results in asymmetric enforcement of528 # XXX this policy results in asymmetric enforcement of
528 # build-dependencies in the release pocket (nothing blocks529 # build-dependencies in the release pocket (nothing blocks
diff --git a/britney2/policies/autopkgtest.py b/britney2/policies/autopkgtest.py
index 7ff8c1f..546a03c 100644
--- a/britney2/policies/autopkgtest.py
+++ b/britney2/policies/autopkgtest.py
@@ -117,7 +117,8 @@ class AutopkgtestPolicy(BasePolicy):
117 reject the upload if any of those regress.117 reject the upload if any of those regress.
118 """118 """
119119
120 def __init__(self, options, suite_info):120 def __init__(self, options, suite_info, dry_run=False):
121
121 super().__init__('autopkgtest', options, suite_info, {SuiteClass.PRIMARY_SOURCE_SUITE})122 super().__init__('autopkgtest', options, suite_info, {SuiteClass.PRIMARY_SOURCE_SUITE})
122 # tests requested in this and previous runs123 # tests requested in this and previous runs
123 # trigger -> src -> [arch]124 # trigger -> src -> [arch]
@@ -126,6 +127,7 @@ class AutopkgtestPolicy(BasePolicy):
126 self.testsuite_triggers = {}127 self.testsuite_triggers = {}
127 self.result_in_baseline_cache = collections.defaultdict(dict)128 self.result_in_baseline_cache = collections.defaultdict(dict)
128 self.database_path = os.path.join(self.state_dir, 'autopkgtest.db')129 self.database_path = os.path.join(self.state_dir, 'autopkgtest.db')
130 self.dry_run = dry_run
129131
130 # results map: trigger -> src -> arch -> [passed, version, run_id, seen]132 # results map: trigger -> src -> arch -> [passed, version, run_id, seen]
131 # - trigger is "source/version" of an unstable package that triggered133 # - trigger is "source/version" of an unstable package that triggered
@@ -292,7 +294,7 @@ class AutopkgtestPolicy(BasePolicy):
292 # Initialize AMQP connection294 # Initialize AMQP connection
293 self.amqp_channel = None295 self.amqp_channel = None
294 self.amqp_file = None296 self.amqp_file = None
295 if self.options.dry_run:297 if self.options.dry_run or self.dry_run:
296 return298 return
297299
298 amqp_url = self.options.adt_amqp300 amqp_url = self.options.adt_amqp
@@ -1117,7 +1119,7 @@ class AutopkgtestPolicy(BasePolicy):
1117 If huge is true, then the request will be put into the -huge instead of1119 If huge is true, then the request will be put into the -huge instead of
1118 normal queue.1120 normal queue.
1119 '''1121 '''
1120 if self.options.dry_run:1122 if self.options.dry_run or self.dry_run:
1121 return1123 return
11221124
1123 params = {'triggers': triggers}1125 params = {'triggers': triggers}

Subscribers

People subscribed via source and target branches