Merge lp:~fginther/cupstream2distro-config/use-stack-ppa-option into lp:cupstream2distro-config

Proposed by Francis Ginther
Status: Merged
Approved by: Chris Gagnon
Approved revision: 565
Merged at revision: 573
Proposed branch: lp:~fginther/cupstream2distro-config/use-stack-ppa-option
Merge into: lp:cupstream2distro-config
Diff against target: 139 lines (+54/-8)
4 files modified
c2dconfigutils/cu2dUpdateCi.py (+7/-5)
ci/config/defaults.conf (+1/-0)
stacks/head/unity8.cfg (+1/-0)
tests/test_cu2dUpdateCi.py (+45/-3)
To merge this branch: bzr merge lp:~fginther/cupstream2distro-config/use-stack-ppa-option
Reviewer Review Type Date Requested Status
Chris Gagnon (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+177283@code.launchpad.net

Commit message

Add 'use_stack_ppa' option (default True) to indicate that the stack's ppa value should be automatically added to the hook list.

Description of the change

Add 'use_stack_ppa' option (default True) to indicate that the stack's ppa value should be automatically added to the hook list.

Tested by dumping results to file with and without the change. Projects that continue to use the default were unchanged. Projects (like unity8) had the appropriate change made to the hooks.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
564. By Francis Ginther

Fix and add tests for use_stack_ppa.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

 'use_stack_ppa': False needs to be in a test.

review: Needs Fixing
565. By Francis Ginther

Add a test case for use_stack_ppa == False.

Revision history for this message
Francis Ginther (fginther) wrote :

> 'use_stack_ppa': False needs to be in a test.

Good catch, tests are update.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Chris Gagnon (chris.gagnon) wrote :

thanks lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'c2dconfigutils/cu2dUpdateCi.py'
--- c2dconfigutils/cu2dUpdateCi.py 2013-06-11 21:23:10 +0000
+++ c2dconfigutils/cu2dUpdateCi.py 2013-07-30 17:07:24 +0000
@@ -85,6 +85,7 @@
85 'rebuild',85 'rebuild',
86 'team',86 'team',
87 'use_description_for_commit',87 'use_description_for_commit',
88 'use_stack_ppa',
88 ]89 ]
8990
90 DEFAULT_HOOK_LOCATION = '/tmp/$JOB_NAME-hooks'91 DEFAULT_HOOK_LOCATION = '/tmp/$JOB_NAME-hooks'
@@ -191,11 +192,12 @@
191 if job_data.get('stack_ppa', False):192 if job_data.get('stack_ppa', False):
192 stack_ppa_hook = self.GENERATED_HOOK_TEMPLATE.format(193 stack_ppa_hook = self.GENERATED_HOOK_TEMPLATE.format(
193 job_data['stack_ppa'].replace('/', '~'))194 job_data['stack_ppa'].replace('/', '~'))
194 if project_config.get('hooks', False):195 if project_config.get('use_stack_ppa', False):
195 project_config['hooks'] = ' '.join([stack_ppa_hook,196 if project_config.get('hooks', False):
196 project_config['hooks']])197 project_config['hooks'] = ' '.join(
197 else:198 [stack_ppa_hook, project_config['hooks']])
198 project_config['hooks'] = stack_ppa_hook199 else:
200 project_config['hooks'] = stack_ppa_hook
199201
200 # Rename hooks parameter for builder jobs202 # Rename hooks parameter for builder jobs
201 if builder_job and 'hooks' in project_config:203 if builder_job and 'hooks' in project_config:
202204
=== modified file 'ci/config/defaults.conf'
--- ci/config/defaults.conf 2013-05-03 05:44:25 +0000
+++ ci/config/defaults.conf 2013-07-30 17:07:24 +0000
@@ -4,6 +4,7 @@
4 autolanding_template: autolanding-config.xml.tmpl4 autolanding_template: autolanding-config.xml.tmpl
5 build_template: pbuilder-config.xml.tmpl5 build_template: pbuilder-config.xml.tmpl
6 hooks: ''6 hooks: ''
7 use_stack_ppa: True
7 packaging_branch: '' 8 packaging_branch: ''
8 use_description_for_commit: False9 use_description_for_commit: False
9 ci:10 ci:
1011
=== modified file 'stacks/head/unity8.cfg'
--- stacks/head/unity8.cfg 2013-07-24 10:17:45 +0000
+++ stacks/head/unity8.cfg 2013-07-30 17:07:24 +0000
@@ -38,6 +38,7 @@
38 projects:38 projects:
39 unity8:39 unity8:
40 hooks: H05set_package_version D00mbs_archive A10checklicenseheaders40 hooks: H05set_package_version D00mbs_archive A10checklicenseheaders
41 use_stack_ppa: False
41 test_suite: unity842 test_suite: unity8
42 aggregate_tests: generic-mediumtests-saucy unity-phablet-qmluitests-saucy43 aggregate_tests: generic-mediumtests-saucy unity-phablet-qmluitests-saucy
43 archive_artifacts: '**/*test*.xml, **/coverage*.xml'44 archive_artifacts: '**/*test*.xml, **/coverage*.xml'
4445
=== modified file 'tests/test_cu2dUpdateCi.py'
--- tests/test_cu2dUpdateCi.py 2013-06-11 21:23:10 +0000
+++ tests/test_cu2dUpdateCi.py 2013-07-30 17:07:24 +0000
@@ -191,11 +191,13 @@
191 self.assertEqual(expected, actual)191 self.assertEqual(expected, actual)
192192
193 def test_project_config_stack_ppa(self):193 def test_project_config_stack_ppa(self):
194 config = {'hooks': 'my_hook'}194 config = {'hooks': 'my_hook',
195 'use_stack_ppa': True}
195 job_data = {'stack_ppa': 'ppa_team/ppa_name'}196 job_data = {'stack_ppa': 'ppa_team/ppa_name'}
196 expected = {'target_branch': 'lp:project',197 expected = {'target_branch': 'lp:project',
197 'project_name': 'project',198 'project_name': 'project',
198 'hooks': 'D09add_ppa~ppa_team~ppa_name my_hook',199 'hooks': 'D09add_ppa~ppa_team~ppa_name my_hook',
200 'use_stack_ppa': True,
199 'parameter_list': [201 'parameter_list': [
200 JobParameter('hooks',202 JobParameter('hooks',
201 'D09add_ppa~ppa_team~ppa_name my_hook'),203 'D09add_ppa~ppa_team~ppa_name my_hook'),
@@ -207,12 +209,50 @@
207 job_data)209 job_data)
208 self.assertEqual(expected, actual)210 self.assertEqual(expected, actual)
209211
212 def test_project_config_stack_false_use_stack_ppa(self):
213 config = {'hooks': 'my_hook',
214 'use_stack_ppa': False}
215 job_data = {'stack_ppa': 'ppa_team/ppa_name'}
216 expected = {'target_branch': 'lp:project',
217 'project_name': 'project',
218 'hooks': 'my_hook',
219 'use_stack_ppa': False,
220 'parameter_list': [
221 JobParameter('hooks',
222 'my_hook'),
223 JobParameter('target_branch',
224 'lp:project'),
225 JobParameter('project_name',
226 'project')]}
227 actual = self.update_ci.process_project_config('project', config,
228 job_data)
229 self.assertEqual(expected, actual)
230
231 def test_project_config_stack_no_use_stack_ppa(self):
232 config = {'hooks': 'my_hook'}
233 job_data = {'stack_ppa': 'ppa_team/ppa_name'}
234 expected = {'target_branch': 'lp:project',
235 'project_name': 'project',
236 'hooks': 'my_hook',
237 'parameter_list': [
238 JobParameter('hooks',
239 'my_hook'),
240 JobParameter('target_branch',
241 'lp:project'),
242 JobParameter('project_name',
243 'project')]}
244 actual = self.update_ci.process_project_config('project', config,
245 job_data)
246 self.assertEqual(expected, actual)
247
210 def test_project_config_stack_ppa_with_no_hooks(self):248 def test_project_config_stack_ppa_with_no_hooks(self):
211 config = {'hooks': ''}249 config = {'hooks': '',
250 'use_stack_ppa': True}
212 job_data = {'stack_ppa': 'ppa_team/ppa_name'}251 job_data = {'stack_ppa': 'ppa_team/ppa_name'}
213 expected = {'target_branch': 'lp:project',252 expected = {'target_branch': 'lp:project',
214 'project_name': 'project',253 'project_name': 'project',
215 'hooks': 'D09add_ppa~ppa_team~ppa_name',254 'hooks': 'D09add_ppa~ppa_team~ppa_name',
255 'use_stack_ppa': True,
216 'parameter_list': [256 'parameter_list': [
217 JobParameter('hooks',257 JobParameter('hooks',
218 'D09add_ppa~ppa_team~ppa_name'),258 'D09add_ppa~ppa_team~ppa_name'),
@@ -225,11 +265,13 @@
225 self.assertEqual(expected, actual)265 self.assertEqual(expected, actual)
226266
227 def test_project_config_stack_ppa_with_false_hooks(self):267 def test_project_config_stack_ppa_with_false_hooks(self):
228 config = {'hooks': False}268 config = {'hooks': False,
269 'use_stack_ppa': True}
229 job_data = {'stack_ppa': 'ppa_team/ppa_name'}270 job_data = {'stack_ppa': 'ppa_team/ppa_name'}
230 expected = {'target_branch': 'lp:project',271 expected = {'target_branch': 'lp:project',
231 'project_name': 'project',272 'project_name': 'project',
232 'hooks': 'D09add_ppa~ppa_team~ppa_name',273 'hooks': 'D09add_ppa~ppa_team~ppa_name',
274 'use_stack_ppa': True,
233 'parameter_list': [275 'parameter_list': [
234 JobParameter('hooks',276 JobParameter('hooks',
235 'D09add_ppa~ppa_team~ppa_name'),277 'D09add_ppa~ppa_team~ppa_name'),

Subscribers

People subscribed via source and target branches

to all changes: