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

Side by Side Diff: unittests/repo_test_util.py

Issue 2782323002: make doc/recipes.py supported version 1 and 2 (Closed)
Patch Set: todo Created 3 years, 8 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
« no previous file with comments | « doc/recipes.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The LUCI Authors. All rights reserved. 1 # Copyright 2016 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """Utilities for testing with real repos (e.g. git).""" 5 """Utilities for testing with real repos (e.g. git)."""
6 6
7 7
8 import contextlib 8 import contextlib
9 import os 9 import os
10 import shutil 10 import shutil
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 'recipe_engine': package_pb2.DepSpec(url="file://"+ROOT_DIR), 124 'recipe_engine': package_pb2.DepSpec(url="file://"+ROOT_DIR),
125 } 125 }
126 for d in repo_deps[k]: 126 for d in repo_deps[k]:
127 deps[d] = package_pb2.DepSpec( 127 deps[d] = package_pb2.DepSpec(
128 url=repos[d]['root'], 128 url=repos[d]['root'],
129 branch='master', 129 branch='master',
130 revision=repos[d]['revision'], 130 revision=repos[d]['revision'],
131 ) 131 )
132 132
133 repos[k] = self.create_repo(k, package_pb2.Package( 133 repos[k] = self.create_repo(k, package_pb2.Package(
134 api_version=1, 134 api_version=2,
135 project_id=k, 135 project_id=k,
136 recipes_path='', 136 recipes_path='',
137 deps=deps, 137 deps=deps,
138 )) 138 ))
139 return repos 139 return repos
140 140
141 def updated_package_spec_pb(self, repo, dep_name, dep_revision): 141 def updated_package_spec_pb(self, repo, dep_name, dep_revision):
142 """Returns package spec for given repo, with specified revision 142 """Returns package spec for given repo, with specified revision
143 for given dependency. 143 for given dependency.
144 """ 144 """
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 message = ' '.join( 315 message = ' '.join(
316 ['update %r recipe_module: ' % name] + 316 ['update %r recipe_module: ' % name] +
317 ['%s(%s)' % t for t in methods.iteritems()] 317 ['%s(%s)' % t for t in methods.iteritems()]
318 ) 318 )
319 return self.commit_in_repo(repo, message) 319 return self.commit_in_repo(repo, message)
320 320
321 def reset_repo(self, repo, revision): 321 def reset_repo(self, repo, revision):
322 """Resets repo contents to given revision.""" 322 """Resets repo contents to given revision."""
323 with in_directory(repo['root']): 323 with in_directory(repo['root']):
324 subprocess.check_output(['git', 'reset', '--hard', revision]) 324 subprocess.check_output(['git', 'reset', '--hard', revision])
OLDNEW
« no previous file with comments | « doc/recipes.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698