Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Side by Side Diff: scripts/slave/recipe_modules/perf_try/api.py

Issue 1776943003: Revert of Remove build directory before performing perf tryjob. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | scripts/slave/recipes/bisection/android_bisect.expected/basic_perf_tryjob_android_fyi_perf_bisect.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 perf try job recipe module. 5 """API for the perf try job recipe module.
6 6
7 This API is meant to enable the perf try job recipe on any chromium-supported 7 This API is meant to enable the perf try job recipe on 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 compile_targets = self.m.chromium_tests.get_compile_targets( 176 compile_targets = self.m.chromium_tests.get_compile_targets(
177 bot_config, bot_db, tests=[]) 177 bot_config, bot_db, tests=[])
178 if self.m.chromium.c.TARGET_PLATFORM == 'android': 178 if self.m.chromium.c.TARGET_PLATFORM == 'android':
179 self.m.chromium_android.clean_local_files() 179 self.m.chromium_android.clean_local_files()
180 compile_targets = None 180 compile_targets = None
181 else: 181 else:
182 # Removes any chrome temporary files or build.dead directories. 182 # Removes any chrome temporary files or build.dead directories.
183 self.m.chromium.cleanup_temp() 183 self.m.chromium.cleanup_temp()
184 184
185 if 'With Patch' in name: 185 if 'With Patch' in name:
186 # We've had some cases where a stale build directory was used on perf
187 # try job leading to unwanted cache and temp data. The best way to
188 # ensure the old build directory is removed before doing any
189 # compilation.
190 self.m.file.rmtree(
191 'build directory',
192 self.m.chromium.c.build_dir.join(self.m.chromium.c.build_config_fs))
193 self.m.chromium_tests.transient_check( 186 self.m.chromium_tests.transient_check(
194 update_step, 187 update_step,
195 lambda transform_name: self.m.chromium_tests.run_mb_and_compile( 188 lambda transform_name: self.m.chromium_tests.run_mb_and_compile(
196 compile_targets, None, name_suffix=transform_name(''))) 189 compile_targets, None, name_suffix=transform_name('')))
197 else: 190 else:
198 self.m.chromium_tests.run_mb_and_compile( 191 self.m.chromium_tests.run_mb_and_compile(
199 compile_targets, None, name_suffix=' %s' % name) 192 compile_targets, None, name_suffix=' %s' % name)
200 193
201 def _run_test(self, cfg, **kwargs): 194 def _run_test(self, cfg, **kwargs):
202 """Runs test from config and return results.""" 195 """Runs test from config and return results."""
203 values, overall_output, retcodes = self.m.bisect_tester.run_test( 196 values, overall_output, retcodes = self.m.bisect_tester.run_test(
204 cfg, **kwargs) 197 cfg, **kwargs)
205 all_values = self.m.bisect_tester.digest_run_results(values, retcodes, cfg) 198 all_values = self.m.bisect_tester.digest_run_results(values, retcodes, cfg)
206 overall_success = True 199 overall_success = True
207 if (not kwargs.get('allow_flakes', True) and 200 if (not kwargs.get('allow_flakes', True) and
208 cfg.get('test_type', 'perf') != 'return_code'): 201 cfg.get('test_type', 'perf') != 'return_code'):
209 overall_success = all(v == 0 for v in retcodes) 202 overall_success = all(v == 0 for v in retcodes)
203 if not overall_success: # pragma: no cover
204 raise self.m.step.StepFailure(
205 'Patched version failed to run performance test.')
210 return { 206 return {
211 'results': all_values, 207 'results': all_values,
212 'ret_code': overall_success, 208 'ret_code': overall_success,
213 'output': ''.join(overall_output) 209 'output': ''.join(overall_output)
214 } 210 }
215 211
216 def _build_and_run_tests(self, cfg, update_step, bot_db, revision, 212 def _build_and_run_tests(self, cfg, update_step, bot_db, revision,
217 **kwargs): 213 **kwargs):
218 """Compiles binaries and runs tests for a given a revision.""" 214 """Compiles binaries and runs tests for a given a revision."""
219 update_step = self._checkout_revision(update_step, bot_db, revision) 215 update_step = self._checkout_revision(update_step, bot_db, revision)
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 507
512 def _prepend_src_to_path_in_command(test_cfg): 508 def _prepend_src_to_path_in_command(test_cfg):
513 command_to_run = [] 509 command_to_run = []
514 for v in test_cfg.get('command').split(): 510 for v in test_cfg.get('command').split():
515 if v in ['./tools/perf/run_benchmark', 511 if v in ['./tools/perf/run_benchmark',
516 'tools/perf/run_benchmark', 512 'tools/perf/run_benchmark',
517 'tools\\perf\\run_benchmark']: 513 'tools\\perf\\run_benchmark']:
518 v = 'src/tools/perf/run_benchmark' 514 v = 'src/tools/perf/run_benchmark'
519 command_to_run.append(v) 515 command_to_run.append(v)
520 test_cfg.update({'command': ' '.join(command_to_run)}) 516 test_cfg.update({'command': ' '.join(command_to_run)})
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipes/bisection/android_bisect.expected/basic_perf_tryjob_android_fyi_perf_bisect.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698