| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Utility class to generate and manage a factory to be passed to a | 5 """Utility class to generate and manage a factory to be passed to a |
| 6 builder dictionary as the 'factory' member, for each builder in c['builders']. | 6 builder dictionary as the 'factory' member, for each builder in c['builders']. |
| 7 | 7 |
| 8 Specifically creates a basic factory that will execute an arbirary annotator | 8 Specifically creates a basic factory that will execute an arbirary annotator |
| 9 script. | 9 script. |
| 10 """ | 10 """ |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 forcibly killed. | 47 forcibly killed. |
| 48 """ | 48 """ |
| 49 factory_properties = factory_properties or {} | 49 factory_properties = factory_properties or {} |
| 50 if recipe: | 50 if recipe: |
| 51 factory_properties.update({'recipe': recipe}) | 51 factory_properties.update({'recipe': recipe}) |
| 52 self._factory_properties = factory_properties | 52 self._factory_properties = factory_properties |
| 53 factory = BuildFactory(build_inherit_factory_properties=False) | 53 factory = BuildFactory(build_inherit_factory_properties=False) |
| 54 factory.properties.update(self._factory_properties, 'AnnotatorFactory') | 54 factory.properties.update(self._factory_properties, 'AnnotatorFactory') |
| 55 cmd_obj = annotator_commands.AnnotatorCommands( | 55 cmd_obj = annotator_commands.AnnotatorCommands( |
| 56 factory, active_master=self.active_master) | 56 factory, active_master=self.active_master) |
| 57 cmd_obj.AddAnnotatedScript(timeout=timeout, max_time=max_time) | 57 |
| 58 runner = cmd_obj.PathJoin(cmd_obj.script_dir, 'annotated_run.py') |
| 59 cmd = [cmd_obj.python, '-u', runner, '--use-factory-properties-from-disk'] |
| 60 cmd = cmd_obj.AddB64GzBuildProperties(cmd) |
| 61 |
| 62 cmd_obj.AddAnnotatedScript(cmd, timeout=timeout, max_time=max_time) |
| 58 | 63 |
| 59 for t in triggers or []: | 64 for t in triggers or []: |
| 60 factory.addStep(commands.CreateTriggerStep( | 65 factory.addStep(commands.CreateTriggerStep( |
| 61 t, trigger_copy_properties=['swarm_hashes'])) | 66 t, trigger_copy_properties=['swarm_hashes'])) |
| 62 | 67 |
| 63 return factory | 68 return factory |
| OLD | NEW |