OLD | NEW |
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 """Entry point for fully-annotated builds. | 5 """Entry point for fully-annotated builds. |
6 | 6 |
7 This script is part of the effort to move all builds to annotator-based | 7 This script is part of the effort to move all builds to annotator-based |
8 systems. Any builder configured to use the AnnotatorFactory.BaseFactory() | 8 systems. Any builder configured to use the AnnotatorFactory.BaseFactory() |
9 found in scripts/master/factory/annotator_factory.py executes a single | 9 found in scripts/master/factory/annotator_factory.py executes a single |
10 AddAnnotatedScript step. That step (found in annotator_commands.py) calls | 10 AddAnnotatedScript step. That step (found in annotator_commands.py) calls |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 for line in run_recipe_help_lines: | 244 for line in run_recipe_help_lines: |
245 l.write_line(line) | 245 l.write_line(line) |
246 | 246 |
247 _isolate_environment() | 247 _isolate_environment() |
248 | 248 |
249 # Find and load the recipe to run. | 249 # Find and load the recipe to run. |
250 try: | 250 try: |
251 recipe_script = universe_view.load_recipe(recipe, engine=engine) | 251 recipe_script = universe_view.load_recipe(recipe, engine=engine) |
252 s.write_line('Running recipe with %s' % (properties,)) | 252 s.write_line('Running recipe with %s' % (properties,)) |
253 | 253 |
254 api = loader.create_recipe_api(recipe_script.LOADED_DEPS, | 254 api = loader.create_recipe_api( |
255 engine, | 255 universe_view.universe.package_deps.root_package, |
256 recipe_test_api.DisabledTestData()) | 256 recipe_script.LOADED_DEPS, |
| 257 recipe_script.path, |
| 258 engine, |
| 259 recipe_test_api.DisabledTestData()) |
257 | 260 |
258 s.add_step_text('running recipe: "%s"' % recipe) | 261 s.add_step_text('running recipe: "%s"' % recipe) |
259 except (loader.LoaderError, ImportError, AssertionError) as e: | 262 except (loader.LoaderError, ImportError, AssertionError) as e: |
260 for line in str(e).splitlines(): | 263 for line in str(e).splitlines(): |
261 s.add_step_text(line) | 264 s.add_step_text(line) |
262 s.set_step_status('EXCEPTION') | 265 s.set_step_status('EXCEPTION') |
263 if engine_flags and engine_flags.use_result_proto: | 266 if engine_flags and engine_flags.use_result_proto: |
264 return result_pb2.Result( | 267 return result_pb2.Result( |
265 failure=result_pb2.Failure( | 268 failure=result_pb2.Failure( |
266 human_reason=str(e), | 269 human_reason=str(e), |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 results.append( | 561 results.append( |
559 loader._invoke_with_properties( | 562 loader._invoke_with_properties( |
560 run_recipe, properties, recipe_script.PROPERTIES, | 563 run_recipe, properties, recipe_script.PROPERTIES, |
561 properties.keys())) | 564 properties.keys())) |
562 except TypeError as e: | 565 except TypeError as e: |
563 raise TypeError( | 566 raise TypeError( |
564 "Got %r while trying to call recipe %s with properties %r" % ( | 567 "Got %r while trying to call recipe %s with properties %r" % ( |
565 e, recipe, properties)) | 568 e, recipe, properties)) |
566 | 569 |
567 return results | 570 return results |
OLD | NEW |