Chromium Code Reviews| 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)]) |