diff options
author | qyearsley <qyearsley@chromium.org> | 2014-11-21 17:11:37 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-22 01:11:57 +0000 |
commit | 35712273409546659d0d143e302a6304076bb441 (patch) | |
tree | 11e32b00916f081d2ef9704e4397979a25d1c874 /tools/run-bisect-perf-regression.py | |
parent | f33ddaa2d86d57867d44eef9916a12b87fb81748 (diff) | |
download | chromium_src-35712273409546659d0d143e302a6304076bb441.zip chromium_src-35712273409546659d0d143e302a6304076bb441.tar.gz chromium_src-35712273409546659d0d143e302a6304076bb441.tar.bz2 |
Modify bisect_perf_regression.py to use functions in fetch_build.py
BUG=402669
Review URL: https://codereview.chromium.org/696133003
Cr-Commit-Position: refs/heads/master@{#305333}
Diffstat (limited to 'tools/run-bisect-perf-regression.py')
-rwxr-xr-x | tools/run-bisect-perf-regression.py | 113 |
1 files changed, 44 insertions, 69 deletions
diff --git a/tools/run-bisect-perf-regression.py b/tools/run-bisect-perf-regression.py index 59db86c..2436015 100755 --- a/tools/run-bisect-perf-regression.py +++ b/tools/run-bisect-perf-regression.py @@ -317,13 +317,10 @@ def _RunPerformanceTest(config): raise RuntimeError('Unpatched version failed to run performance test.') # Find the link to the cloud stored results file. - cloud_file_link = _ParseCloudLinksFromOutput(results_without_patch[2], - 'html-results') - output = results_without_patch[2] - if cloud_file_link: - cloud_file_link = cloud_file_link[0] - else: - cloud_file_link = '' + cloud_file_link = _ParseCloudLinksFromOutput( + results_without_patch[2], 'html-results') + + cloud_file_link = cloud_file_link[0] if cloud_file_link else '' profiler_file_links_with_patch = _ParseCloudLinksFromOutput( results_with_patch[2], 'profiling-results') @@ -415,62 +412,50 @@ def _RunBisectionScript( """ _PrintConfigStep(config) - cmd = ['python', os.path.join(BISECT_SCRIPT_DIR, 'bisect_perf_regression.py'), - '-c', config['command'], - '-g', config['good_revision'], - '-b', config['bad_revision'], - '-m', config['metric'], - '--working_directory', working_directory, - '--output_buildbot_annotations'] - - if config.get('metric'): - cmd.extend(['-m', config['metric']]) - - if config['repeat_count']: - cmd.extend(['-r', config['repeat_count']]) - - if config['truncate_percent']: - cmd.extend(['-t', config['truncate_percent']]) - - if config['max_time_minutes']: - cmd.extend(['--max_time_minutes', config['max_time_minutes']]) - - if config.has_key('bisect_mode'): - cmd.extend(['--bisect_mode', config['bisect_mode']]) - - if config.has_key('improvement_direction'): - cmd.extend(['-d', config['improvement_direction']]) + # Construct the basic command with all necessary arguments. + cmd = [ + 'python', + os.path.join(BISECT_SCRIPT_DIR, 'bisect_perf_regression.py'), + '--command', config['command'], + '--good_revision', config['good_revision'], + '--bad_revision', config['bad_revision'], + '--metric', config['metric'], + '--working_directory', working_directory, + '--output_buildbot_annotations' + ] - if config.has_key('bug_id'): - cmd.extend(['--bug_id', config['bug_id']]) + # Add flags for any optional config parameters if given in the config. + options = [ + ('repeat_count', '--repeat_test_count'), + ('truncate_percent', '--truncate_percent'), + ('max_time_minutes', '--max_time_minutes'), + ('bisect_mode', '--bisect_mode'), + ('improvement_direction', '--improvement_direction'), + ('bug_id', '--bug_id'), + ('builder_host', '--builder_host'), + ('builder_port', '--builder_port'), + ] + for config_key, flag in options: + if config.has_key(config_key): + cmd.extend([flag, config[config_key]]) cmd.extend(['--build_preference', 'ninja']) - if '--browser=cros' in config['command']: - cmd.extend(['--target_platform', 'cros']) - - if os.environ[CROS_BOARD_ENV] and os.environ[CROS_IP_ENV]: - cmd.extend(['--cros_board', os.environ[CROS_BOARD_ENV]]) - cmd.extend(['--cros_remote_ip', os.environ[CROS_IP_ENV]]) - else: - print ('Error: Cros build selected, but BISECT_CROS_IP or' - 'BISECT_CROS_BOARD undefined.\n') - return 1 - - if 'android' in config['command']: - if 'android-chrome-shell' in config['command']: - cmd.extend(['--target_platform', 'android']) - elif 'android-chrome' in config['command']: - cmd.extend(['--target_platform', 'android-chrome']) - else: - cmd.extend(['--target_platform', 'android']) + # Possibly set the target platform name based on the browser name in a + # Telemetry command. + if 'android-chrome-shell' in config['command']: + cmd.extend(['--target_platform', 'android']) + elif 'android-chrome' in config['command']: + cmd.extend(['--target_platform', 'android-chrome']) + elif 'android' in config['command']: + cmd.extend(['--target_platform', 'android']) if path_to_goma: # For Windows XP platforms, goma service is not supported. # Moreover we don't compile chrome when gs_bucket flag is set instead # use builds archives, therefore ignore goma service for Windows XP. # See http://crbug.com/330900. - if config.get('gs_bucket') and platform.release() == 'XP': + if platform.release() == 'XP': print ('Goma doesn\'t have a win32 binary, therefore it is not supported ' 'on Windows XP platform. Please refer to crbug.com/330900.') path_to_goma = None @@ -479,23 +464,13 @@ def _RunBisectionScript( if path_to_extra_src: cmd.extend(['--extra_src', path_to_extra_src]) - # These flags are used to download build archives from cloud storage if - # available, otherwise will post a try_job_http request to build it on the - # try server. - if config.get('gs_bucket'): - if config.get('builder_host') and config.get('builder_port'): - cmd.extend(['--gs_bucket', config['gs_bucket'], - '--builder_host', config['builder_host'], - '--builder_port', config['builder_port'] - ]) - else: - print ('Error: Specified gs_bucket, but missing builder_host or ' - 'builder_port information in config.') - return 1 - if dry_run: - cmd.extend(['--debug_ignore_build', '--debug_ignore_sync', - '--debug_ignore_perf_test']) + cmd.extend([ + '--debug_ignore_build', + '--debug_ignore_sync', + '--debug_ignore_perf_test' + ]) + cmd = [str(c) for c in cmd] with Goma(path_to_goma) as _: |