Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Side by Side Diff: recipe_modules/bot_update/example.py

Issue 2294413002: bot_update: add --auth-refresh-token-json passthrough for apply_issue (Closed)
Patch Set: More coverage Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 DEPS = [ 5 DEPS = [
6 'bot_update', 6 'bot_update',
7 'gclient', 7 'gclient',
8 'recipe_engine/platform',
8 'recipe_engine/path', 9 'recipe_engine/path',
9 'recipe_engine/properties', 10 'recipe_engine/properties',
10 ] 11 ]
11 12
12 def RunSteps(api): 13 def RunSteps(api):
13 api.gclient.use_mirror = True 14 api.gclient.use_mirror = True
14 15
15 src_cfg = api.gclient.make_config(CACHE_DIR='[GIT_CACHE]') 16 src_cfg = api.gclient.make_config(CACHE_DIR='[GIT_CACHE]')
16 soln = src_cfg.solutions.add() 17 soln = src_cfg.solutions.add()
17 soln.name = 'src' 18 soln.name = 'src'
18 soln.url = 'https://chromium.googlesource.com/chromium/src.git' 19 soln.url = 'https://chromium.googlesource.com/chromium/src.git'
19 soln.revision = api.properties.get('revision') 20 soln.revision = api.properties.get('revision')
20 api.gclient.c = src_cfg 21 api.gclient.c = src_cfg
21 api.gclient.c.revisions.update(api.properties.get('revisions', {})) 22 api.gclient.c.revisions.update(api.properties.get('revisions', {}))
22 api.gclient.c.got_revision_mapping['src'] = 'got_cr_revision' 23 api.gclient.c.got_revision_mapping['src'] = 'got_cr_revision'
23 api.gclient.c.patch_projects['v8'] = ('src/v8', 'HEAD') 24 api.gclient.c.patch_projects['v8'] = ('src/v8', 'HEAD')
24 api.gclient.c.patch_projects['angle/angle'] = ('src/third_party/angle', 25 api.gclient.c.patch_projects['angle/angle'] = ('src/third_party/angle',
25 'HEAD') 26 'HEAD')
26 patch = api.properties.get('patch', True) 27 patch = api.properties.get('patch', True)
27 clobber = True if api.properties.get('clobber') else False 28 clobber = True if api.properties.get('clobber') else False
28 no_shallow = True if api.properties.get('no_shallow') else False 29 no_shallow = True if api.properties.get('no_shallow') else False
29 output_manifest = api.properties.get('output_manifest', False) 30 output_manifest = api.properties.get('output_manifest', False)
30 with_branch_heads = api.properties.get('with_branch_heads', False) 31 with_branch_heads = api.properties.get('with_branch_heads', False)
31 refs = api.properties.get('refs', []) 32 refs = api.properties.get('refs', [])
32 oauth2 = api.properties.get('oauth2', False) 33 oauth2 = api.properties.get('oauth2', False)
34 oauth2_json = api.properties.get('oauth2_json', False)
33 root_solution_revision = api.properties.get('root_solution_revision') 35 root_solution_revision = api.properties.get('root_solution_revision')
34 suffix = api.properties.get('suffix') 36 suffix = api.properties.get('suffix')
35 gerrit_no_reset = True if api.properties.get('gerrit_no_reset') else False 37 gerrit_no_reset = True if api.properties.get('gerrit_no_reset') else False
36 gerrit_no_rebase_patch_ref = bool( 38 gerrit_no_rebase_patch_ref = bool(
37 api.properties.get('gerrit_no_rebase_patch_ref')) 39 api.properties.get('gerrit_no_rebase_patch_ref'))
38 40
39 if api.properties.get('test_apply_gerrit_ref'): 41 if api.properties.get('test_apply_gerrit_ref'):
40 api.bot_update.apply_gerrit_ref( 42 api.bot_update.apply_gerrit_ref(
41 root='/tmp/test/root', 43 root='/tmp/test/root',
42 gerrit_no_reset=gerrit_no_reset, 44 gerrit_no_reset=gerrit_no_reset,
43 gerrit_no_rebase_patch_ref=gerrit_no_rebase_patch_ref) 45 gerrit_no_rebase_patch_ref=gerrit_no_rebase_patch_ref)
44 else: 46 else:
45 api.bot_update.ensure_checkout( 47 api.bot_update.ensure_checkout(
46 no_shallow=no_shallow, 48 no_shallow=no_shallow,
47 patch=patch, 49 patch=patch,
48 with_branch_heads=with_branch_heads, 50 with_branch_heads=with_branch_heads,
49 output_manifest=output_manifest, 51 output_manifest=output_manifest,
50 refs=refs, patch_oauth2=oauth2, 52 refs=refs, patch_oauth2=oauth2,
53 oauth2_json=oauth2_json,
51 clobber=clobber, 54 clobber=clobber,
52 root_solution_revision=root_solution_revision, 55 root_solution_revision=root_solution_revision,
53 suffix=suffix, 56 suffix=suffix,
54 gerrit_no_reset=gerrit_no_reset, 57 gerrit_no_reset=gerrit_no_reset,
55 gerrit_no_rebase_patch_ref=gerrit_no_rebase_patch_ref) 58 gerrit_no_rebase_patch_ref=gerrit_no_rebase_patch_ref)
56 59
57 60
58 def GenTests(api): 61 def GenTests(api):
59 yield api.test('basic') + api.properties( 62 yield api.test('basic') + api.properties(
60 patch=False, 63 patch=False,
(...skipping 10 matching lines...) Expand all
71 issue=12345, 74 issue=12345,
72 patchset=654321, 75 patchset=654321,
73 rietveld='https://rietveld.example.com/', 76 rietveld='https://rietveld.example.com/',
74 ) 77 )
75 yield api.test('trychange') + api.properties( 78 yield api.test('trychange') + api.properties(
76 refs=['+refs/change/1/2/333'], 79 refs=['+refs/change/1/2/333'],
77 ) 80 )
78 yield api.test('trychange_oauth2') + api.properties( 81 yield api.test('trychange_oauth2') + api.properties(
79 oauth2=True, 82 oauth2=True,
80 ) 83 )
84 yield api.test('trychange_oauth2_json') + api.properties(
85 mastername='tryserver.chromium.linux',
86 buildername='linux_rel',
87 slavename='totallyaslave-c4',
88 oauth2_json=True,
89 )
90 yield api.test('trychange_oauth2_json_win') + api.properties(
91 mastername='tryserver.chromium.win',
92 buildername='win_rel',
93 slavename='totallyaslave-c4',
94 oauth2_json=True,
95 ) + api.platform('win', 64)
81 yield api.test('tryjob_fail') + api.properties( 96 yield api.test('tryjob_fail') + api.properties(
82 issue=12345, 97 issue=12345,
83 patchset=654321, 98 patchset=654321,
84 rietveld='https://rietveld.example.com/', 99 rietveld='https://rietveld.example.com/',
85 ) + api.step_data('bot_update', retcode=1) 100 ) + api.step_data('bot_update', retcode=1)
86 yield api.test('tryjob_fail_patch') + api.properties( 101 yield api.test('tryjob_fail_patch') + api.properties(
87 issue=12345, 102 issue=12345,
88 patchset=654321, 103 patchset=654321,
89 rietveld='https://rietveld.example.com/', 104 rietveld='https://rietveld.example.com/',
90 fail_patch='apply', 105 fail_patch='apply',
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 rietveld='https://rietveld.example.com/', 137 rietveld='https://rietveld.example.com/',
123 patch_project='v8', 138 patch_project='v8',
124 revisions={'src/v8': 'abc'} 139 revisions={'src/v8': 'abc'}
125 ) 140 )
126 yield api.test('tryjob_v8_head_by_default') + api.properties.tryserver( 141 yield api.test('tryjob_v8_head_by_default') + api.properties.tryserver(
127 patch_project='v8', 142 patch_project='v8',
128 ) 143 )
129 yield api.test('tryjob_gerrit_angle') + api.properties.tryserver_gerrit( 144 yield api.test('tryjob_gerrit_angle') + api.properties.tryserver_gerrit(
130 full_project_name='angle/angle', 145 full_project_name='angle/angle',
131 ) 146 )
OLDNEW
« no previous file with comments | « recipe_modules/bot_update/api.py ('k') | recipe_modules/bot_update/example.expected/trychange_oauth2_json.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698