OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2017 The LUCI Authors. All rights reserved. | 2 # Copyright 2017 The LUCI Authors. All rights reserved. |
3 # Use of this source code is governed under the Apache License, Version 2.0 | 3 # Use of this source code is governed under the Apache License, Version 2.0 |
4 # that can be found in the LICENSE file. | 4 # that can be found in the LICENSE file. |
5 | 5 |
6 import json | 6 import json |
7 import os | 7 import os |
8 import shutil | 8 import shutil |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 os.makedirs(config_dir) | 208 os.makedirs(config_dir) |
209 | 209 |
210 self._root_dir = root_dir | 210 self._root_dir = root_dir |
211 self._recipes_cfg = os.path.join(config_dir, 'recipes.cfg') | 211 self._recipes_cfg = os.path.join(config_dir, 'recipes.cfg') |
212 self._recipe_tool = os.path.join(ROOT_DIR, 'recipes.py') | 212 self._recipe_tool = os.path.join(ROOT_DIR, 'recipes.py') |
213 | 213 |
214 test_pkg = package_pb2.Package( | 214 test_pkg = package_pb2.Package( |
215 api_version=1, | 215 api_version=1, |
216 project_id='test_pkg', | 216 project_id='test_pkg', |
217 recipes_path='', | 217 recipes_path='', |
218 deps={ | 218 deps=[ |
219 'recipe_engine': package_pb2.DepSpec(url='file://'+ROOT_DIR), | 219 package_pb2.DepSpec( |
220 } | 220 project_id='recipe_engine', |
| 221 url='file://'+ROOT_DIR), |
| 222 ], |
221 ) | 223 ) |
222 package.ProtoFile(self._recipes_cfg).write(test_pkg) | 224 package.ProtoFile(self._recipes_cfg).write(test_pkg) |
223 | 225 |
224 self.maxDiff = None | 226 self.maxDiff = None |
225 | 227 |
226 def tearDown(self): | 228 def tearDown(self): |
227 shutil.rmtree(self._root_dir) | 229 shutil.rmtree(self._root_dir) |
228 | 230 |
229 @property | 231 @property |
230 def json_path(self): | 232 def json_path(self): |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 rw.RunStepsLines = ['pass'] | 803 rw.RunStepsLines = ['pass'] |
802 rw.GenTestsLines = ['yield api.test(%r)' % test_name] | 804 rw.GenTestsLines = ['yield api.test(%r)' % test_name] |
803 rw.add_expectation(test_name) | 805 rw.add_expectation(test_name) |
804 rw.write() | 806 rw.write() |
805 self._run_recipes('test', 'run', '--json', self.json_path) | 807 self._run_recipes('test', 'run', '--json', self.json_path) |
806 self.assertEqual(self.json_generator.get(), self.json_contents) | 808 self.assertEqual(self.json_generator.get(), self.json_contents) |
807 | 809 |
808 | 810 |
809 if __name__ == '__main__': | 811 if __name__ == '__main__': |
810 sys.exit(unittest.main()) | 812 sys.exit(unittest.main()) |
OLD | NEW |