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

Unified Diff: unittests/repo_test_util.py

Issue 2664223002: Add unit tests for overrides in multi-repo workflow (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« unittests/override_test.py ('K') | « unittests/override_test.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: unittests/repo_test_util.py
diff --git a/unittests/repo_test_util.py b/unittests/repo_test_util.py
index 2e7985361a6f91475748ccc696d71e105d7d935c..67679c73f205b0bba77dec85937fce2b2a2d5ab9 100644
--- a/unittests/repo_test_util.py
+++ b/unittests/repo_test_util.py
@@ -177,6 +177,23 @@ class RepoTest(unittest.TestCase):
'message': message,
}
+ def train_recipes(self, repo, overrides=None):
iannucci 2017/01/31 18:22:54 docstring please
Paweł Hajdan Jr. 2017/01/31 18:30:54 Yup, done. I just wasn't sure what you'd think ab
+ if not overrides:
+ overrides = []
+ with in_directory(repo['root']):
+ args = [
+ sys.executable, self._recipe_tool,
+ '--package', os.path.join(
+ repo['root'], 'infra', 'config', 'recipes.cfg'),
+ ]
+ for repo, path in overrides:
+ args.extend(['-O', '%s=%s' % (repo, path)])
+ args.extend([
+ 'simulation_test',
+ 'train',
+ ])
+ subprocess.check_output(args, stderr=subprocess.STDOUT)
+
def update_recipe(self, repo, name, deps, calls):
"""Updates or creates a recipe in given repo.
Commits the change.
@@ -205,13 +222,7 @@ class RepoTest(unittest.TestCase):
' yield api.test("basic")',
]))
- subprocess.check_output([
- sys.executable, self._recipe_tool,
- '--package', os.path.join(
- repo['root'], 'infra', 'config', 'recipes.cfg'),
- 'simulation_test',
- 'train',
- ])
+ self.train_recipes(repo)
subprocess.check_call(
['git', 'add', os.path.join(recipes_dir, '%s.py' % name)])
« unittests/override_test.py ('K') | « unittests/override_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698