| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 from slave import recipe_api | 5 from slave import recipe_api |
| 6 | 6 |
| 7 ISOLATE_SERVER = 'https://isolateserver.appspot.com' | 7 ISOLATE_SERVER = 'https://isolateserver.appspot.com' |
| 8 | 8 |
| 9 class IsolateApi(recipe_api.RecipeApi): | 9 class IsolateApi(recipe_api.RecipeApi): |
| 10 """APIs for interacting with isolates.""" | 10 """APIs for interacting with isolates.""" |
| 11 | 11 |
| 12 def __init__(self, **kwargs): | 12 def __init__(self, **kwargs): |
| 13 super(IsolateApi, self).__init__(**kwargs) | 13 super(IsolateApi, self).__init__(**kwargs) |
| 14 self._manifest_hashes = {} | 14 self._manifest_hashes = {} |
| 15 | 15 |
| 16 def set_isolate_environment(self, config): | 16 def set_isolate_environment(self, config): |
| 17 """Modifies the passed Config (which should generally be api.chromium.c) | 17 """Modifies the passed Config (which should generally be api.chromium.c) |
| 18 to set up the appropriate GYP_DEFINES to upload isolates to the isolate | 18 to set up the appropriate GYP_DEFINES to upload isolates to the isolate |
| 19 server during the build. This must be called early in your recipe; | 19 server during the build. This must be called early in your recipe; |
| 20 definitely before the checkout and runhooks steps.""" | 20 definitely before the checkout and runhooks steps.""" |
| 21 assert config.gyp_env.GYP_DEFINES['component'] != 'shared_library', ( | 21 assert config.gyp_env.GYP_DEFINES['component'] != 'shared_library', ( |
| 22 "isolates don't work with the component build yet; see crbug.com/333473") | 22 "isolates don't work with the component build yet; see crbug.com/333473") |
| 23 config.gyp_env.GYP_DEFINES['test_isolation_mode'] = 'hashtable' | 23 config.gyp_env.GYP_DEFINES['test_isolation_mode'] = 'archive' |
| 24 config.gyp_env.GYP_DEFINES['test_isolation_outdir'] = ISOLATE_SERVER | 24 config.gyp_env.GYP_DEFINES['test_isolation_outdir'] = ISOLATE_SERVER |
| 25 | 25 |
| 26 @recipe_api.inject_test_data | 26 @recipe_api.inject_test_data |
| 27 def manifest_to_hash(self, targets): | 27 def manifest_to_hash(self, targets): |
| 28 """Returns a step which runs manifest_to_hash.py against the given array | 28 """Returns a step which runs manifest_to_hash.py against the given array |
| 29 of targets. Assigns the result to the swarm_hashes factory property. | 29 of targets. Assigns the result to the swarm_hashes factory property. |
| 30 (This implies this step can currently only be run once per recipe.)""" | 30 (This implies this step can currently only be run once per recipe.)""" |
| 31 def followup_fn(step_result): | 31 def followup_fn(step_result): |
| 32 self._manifest_hashes = step_result.json.output | 32 self._manifest_hashes = step_result.json.output |
| 33 step_result.presentation.properties['swarm_hashes'] = ( | 33 step_result.presentation.properties['swarm_hashes'] = ( |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 return self.m.chromium.run_telemetry_test( | 88 return self.m.chromium.run_telemetry_test( |
| 89 self.run_isolated_path, | 89 self.run_isolated_path, |
| 90 test, | 90 test, |
| 91 # When running the Telemetry test via an isolate we need to tell | 91 # When running the Telemetry test via an isolate we need to tell |
| 92 # run_isolated.py the hash and isolate server first, and then give | 92 # run_isolated.py the hash and isolate server first, and then give |
| 93 # the isolate the test name and other arguments separately. | 93 # the isolate the test name and other arguments separately. |
| 94 prefix_args=self.runtest_args_list(isolate_name) + ['--'], | 94 prefix_args=self.runtest_args_list(isolate_name) + ['--'], |
| 95 args=args, | 95 args=args, |
| 96 name=name, | 96 name=name, |
| 97 **runtest_kwargs) | 97 **runtest_kwargs) |
| OLD | NEW |