| 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 | 7 |
| 8 class IsolateApi(recipe_api.RecipeApi): | 8 class IsolateApi(recipe_api.RecipeApi): |
| 9 """APIs for interacting with isolates.""" | 9 """APIs for interacting with isolates.""" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 server during the build. This must be called early in your recipe; | 31 server during the build. This must be called early in your recipe; |
| 32 definitely before the checkout and runhooks steps. | 32 definitely before the checkout and runhooks steps. |
| 33 | 33 |
| 34 Uses current values of self.isolate_server. It should be property configured | 34 Uses current values of self.isolate_server. It should be property configured |
| 35 before calling this method if the default value (production instance of | 35 before calling this method if the default value (production instance of |
| 36 Isolate service) is not ok. | 36 Isolate service) is not ok. |
| 37 """ | 37 """ |
| 38 config.gyp_env.GYP_DEFINES['test_isolation_mode'] = 'archive' | 38 config.gyp_env.GYP_DEFINES['test_isolation_mode'] = 'archive' |
| 39 config.gyp_env.GYP_DEFINES['test_isolation_outdir'] = self._isolate_server | 39 config.gyp_env.GYP_DEFINES['test_isolation_outdir'] = self._isolate_server |
| 40 | 40 |
| 41 def clean_isolated_files(self, build_dir): |
| 42 """Cleans out all *.isolated files from the build directory in |
| 43 preparation for the compile. Needed in order to ensure isolates |
| 44 are rebuilt properly because their dependencies are currently not |
| 45 completely described to gyp.""" |
| 46 self.m.python( |
| 47 'clean isolated files', |
| 48 self.resource('find_isolated_tests.py'), |
| 49 [ |
| 50 '--build-dir', build_dir, |
| 51 '--clean-isolated-files' |
| 52 ]) |
| 53 |
| 41 def find_isolated_tests(self, build_dir, targets=None, **kwargs): | 54 def find_isolated_tests(self, build_dir, targets=None, **kwargs): |
| 42 """Returns a step which finds all *.isolated files in a build directory. | 55 """Returns a step which finds all *.isolated files in a build directory. |
| 43 | 56 |
| 44 Assigns the dict {target name -> *.isolated file hash} to the swarm_hashes | 57 Assigns the dict {target name -> *.isolated file hash} to the swarm_hashes |
| 45 build property. This implies this step can currently only be run once | 58 build property. This implies this step can currently only be run once |
| 46 per recipe. | 59 per recipe. |
| 47 | 60 |
| 48 If |targets| is None, the step will use all *.isolated files it finds. | 61 If |targets| is None, the step will use all *.isolated files it finds. |
| 49 Otherwise, it will verify that all |targets| are found and will use only | 62 Otherwise, it will verify that all |targets| are found and will use only |
| 50 them. If some expected targets are missing, will abort the build. | 63 them. If some expected targets are missing, will abort the build. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 # When running the Telemetry test via an isolate we need to tell | 174 # When running the Telemetry test via an isolate we need to tell |
| 162 # run_isolated.py the hash and isolate server first, and then give | 175 # run_isolated.py the hash and isolate server first, and then give |
| 163 # the isolate the test name and other arguments separately. | 176 # the isolate the test name and other arguments separately. |
| 164 prefix_args=self.runtest_args_list(isolate_name), | 177 prefix_args=self.runtest_args_list(isolate_name), |
| 165 args=args, | 178 args=args, |
| 166 name=name, | 179 name=name, |
| 167 revision=revision, | 180 revision=revision, |
| 168 webkit_revision=webkit_revision, | 181 webkit_revision=webkit_revision, |
| 169 master_class_name=master_class_name, | 182 master_class_name=master_class_name, |
| 170 **runtest_kwargs) | 183 **runtest_kwargs) |
| OLD | NEW |