Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 """API for the bisect recipe module. | 5 """API for the bisect recipe module. |
| 6 | 6 |
| 7 This API is meant to enable the bisect recipe to bisect any chromium-supported | 7 This API is meant to enable the bisect recipe to bisect any chromium-supported |
| 8 platform for any test that can be run via buildbot, perf or otherwise. | 8 platform for any test that can be run via buildbot, perf or otherwise. |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 155 except self.m.step.StepFailure: # pragma: no cover | 155 except self.m.step.StepFailure: # pragma: no cover |
| 156 self.surface_result('BAD_REV') | 156 self.surface_result('BAD_REV') |
| 157 raise | 157 raise |
| 158 | 158 |
| 159 def run_bisect_script(self, **kwargs): | 159 def run_bisect_script(self, **kwargs): |
| 160 """Executes src/tools/run-perf-bisect-regression.py to perform bisection.""" | 160 """Executes src/tools/run-perf-bisect-regression.py to perform bisection.""" |
| 161 self.m.python( | 161 self.m.python( |
| 162 'Preparing for Bisection', | 162 'Preparing for Bisection', |
| 163 script=self.m.path['checkout'].join( | 163 script=self.m.path['checkout'].join( |
| 164 'tools', 'prepare-bisect-perf-regression.py'), | 164 'tools', 'prepare-bisect-perf-regression.py'), |
| 165 args=['-w', self.m.path['slave_build']]) | 165 args=['-w', self.m.path['cache'].join('bisect')]) |
| 166 args = [] | 166 args = [] |
| 167 | 167 |
| 168 kwargs['allow_subannotations'] = True | 168 kwargs['allow_subannotations'] = True |
| 169 | 169 |
| 170 # TODO(prasadv): Remove this once bisect runs are no longer running | 170 # TODO(prasadv): Remove this once bisect runs are no longer running |
| 171 # against revisions from February 2016 or earlier. | 171 # against revisions from February 2016 or earlier. |
| 172 if self.internal_bisect: # pragma: no cover | 172 if self.internal_bisect: # pragma: no cover |
| 173 kwargs['env'] = {'CHROMIUM_OUTPUT_DIR': self.m.chromium.output_dir} | 173 kwargs['env'] = {'CHROMIUM_OUTPUT_DIR': self.m.chromium.output_dir} |
| 174 | 174 |
| 175 if kwargs.get('extra_src'): | 175 if kwargs.get('extra_src'): |
| 176 args = args + ['--extra_src', kwargs.pop('extra_src')] | 176 args = args + ['--extra_src', kwargs.pop('extra_src')] |
| 177 if kwargs.get('path_to_config'): | 177 if kwargs.get('path_to_config'): |
| 178 args = args + ['--path_to_config', kwargs.pop('path_to_config')] | 178 args = args + ['--path_to_config', kwargs.pop('path_to_config')] |
| 179 if self.m.chromium.c.TARGET_PLATFORM != 'android': | 179 if self.m.chromium.c.TARGET_PLATFORM != 'android': |
| 180 # TODO(phajdan.jr): update for swarming, http://crbug.com/585401 . | 180 goma_dir = self.m.goma.ensure_goma() |
|
tandrii(chromium)
2016/08/08 12:58:12
no longer valid, or should 585401 this be referenc
Paweł Hajdan Jr.
2016/08/08 12:59:14
Ah, I added it to BUG= line.
| |
| 181 args += ['--path_to_goma', self.m.path['build'].join('goma')] | 181 args += ['--path_to_goma', goma_dir] |
| 182 args += [ | 182 args += [ |
| 183 '--build-properties', | 183 '--build-properties', |
| 184 self.m.json.dumps(dict(self.m.properties.legacy())), | 184 self.m.json.dumps(dict(self.m.properties.legacy())), |
| 185 ] | 185 ] |
| 186 self.m.chromium.runtest( | 186 self.m.chromium.runtest( |
| 187 self.m.path['checkout'].join('tools', 'run-bisect-perf-regression.py'), | 187 self.m.path['checkout'].join('tools', 'run-bisect-perf-regression.py'), |
| 188 ['-w', self.m.path['slave_build']] + args, | 188 ['-w', self.m.path['cache'].join('bisect')] + args, |
| 189 name='Running Bisection', | 189 name='Running Bisection', |
| 190 xvfb=True, **kwargs) | 190 xvfb=True, **kwargs) |
| 191 | 191 |
| 192 def run_local_test_run(self, test_config_params, | 192 def run_local_test_run(self, test_config_params, |
| 193 skip_download=False): # pragma: no cover | 193 skip_download=False): # pragma: no cover |
| 194 """Starts a test run on the same machine. | 194 """Starts a test run on the same machine. |
| 195 | 195 |
| 196 This is for the merged director/tester flow. | 196 This is for the merged director/tester flow. |
| 197 """ | 197 """ |
| 198 if self.m.platform.is_win: | 198 if self.m.platform.is_win: |
| 199 self.m.chromium.taskkill() | 199 self.m.chromium.taskkill() |
| 200 | 200 |
| 201 if skip_download: | 201 if skip_download: |
| 202 update_step = None | 202 update_step = None |
| 203 else: | 203 else: |
| 204 update_step = self._SyncRevisionToTest(test_config_params) | 204 update_step = self._SyncRevisionToTest(test_config_params) |
| 205 self.start_test_run_for_bisect(update_step, self.bot_db, | 205 self.start_test_run_for_bisect(update_step, self.bot_db, |
| 206 test_config_params, run_locally=True, | 206 test_config_params, run_locally=True, |
| 207 skip_download=skip_download) | 207 skip_download=skip_download) |
| 208 | 208 |
| 209 def ensure_checkout(self, *args, **kwargs): | |
| 210 checkout_dir = self.m.chromium_tests.get_checkout_dir({}) | |
| 211 if checkout_dir: | |
| 212 kwargs.setdefault('cwd', checkout_dir) | |
| 213 | |
| 214 return self.m.bot_update.ensure_checkout(*args, **kwargs) | |
| 215 | |
| 209 def _SyncRevisionToTest(self, test_config_params): # pragma: no cover | 216 def _SyncRevisionToTest(self, test_config_params): # pragma: no cover |
| 210 if not self.internal_bisect: | 217 if not self.internal_bisect: |
| 211 return self.m.bot_update.ensure_checkout( | 218 return self.ensure_checkout( |
| 212 root_solution_revision=test_config_params['revision']) | 219 root_solution_revision=test_config_params['revision']) |
| 213 else: | 220 else: |
| 214 return self._SyncRevisionsForAndroidChrome( | 221 return self._SyncRevisionsForAndroidChrome( |
| 215 test_config_params['revision_ladder']) | 222 test_config_params['revision_ladder']) |
| 216 | 223 |
| 217 def _SyncRevisionsForAndroidChrome(self, revision_ladder): # pragma: no cover | 224 def _SyncRevisionsForAndroidChrome(self, revision_ladder): # pragma: no cover |
| 218 """Syncs android-chrome and chromium repos to particular revision.""" | 225 """Syncs android-chrome and chromium repos to particular revision.""" |
| 219 revisions = [] | 226 revisions = [] |
| 220 for d, r in revision_ladder.iteritems(): | 227 for d, r in revision_ladder.iteritems(): |
| 221 revisions.append('%s@%s' % (depot_config.DEPOT_DEPS_NAME[d]['src'], r)) | 228 revisions.append('%s@%s' % (depot_config.DEPOT_DEPS_NAME[d]['src'], r)) |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 386 api.step('***PERF TRYJOB***', []) | 393 api.step('***PERF TRYJOB***', []) |
| 387 self.m.perf_try.start_perf_try_job( | 394 self.m.perf_try.start_perf_try_job( |
| 388 affected_files, update_step, self.bot_db) | 395 affected_files, update_step, self.bot_db) |
| 389 finally: | 396 finally: |
| 390 if api.chromium.c.TARGET_PLATFORM == 'android': | 397 if api.chromium.c.TARGET_PLATFORM == 'android': |
| 391 if self.internal_bisect: # pragma: no cover | 398 if self.internal_bisect: # pragma: no cover |
| 392 api.chromium_android.init_and_sync( | 399 api.chromium_android.init_and_sync( |
| 393 gclient_config=api.chromium_android.c.internal_dir_name, | 400 gclient_config=api.chromium_android.c.internal_dir_name, |
| 394 use_bot_update=True) | 401 use_bot_update=True) |
| 395 else: | 402 else: |
| 396 api.bot_update.ensure_checkout() | 403 self.ensure_checkout() |
| 397 api.chromium_android.common_tests_final_steps() | 404 api.chromium_android.common_tests_final_steps() |
| OLD | NEW |