diff options
author | robertocn <robertocn@chromium.org> | 2014-11-03 11:50:29 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-03 19:50:46 +0000 |
commit | b20bc1fcb69905c2edd73e690b0b6ec58e658ec0 (patch) | |
tree | 5b7a4a62fb2e56f24c7e3e1bea72fb159d20ddb9 /tools/run-bisect-perf-regression.py | |
parent | bc7acfc27311c25129780ccf9c2c56698f475d00 (diff) | |
download | chromium_src-b20bc1fcb69905c2edd73e690b0b6ec58e658ec0.zip chromium_src-b20bc1fcb69905c2edd73e690b0b6ec58e658ec0.tar.gz chromium_src-b20bc1fcb69905c2edd73e690b0b6ec58e658ec0.tar.bz2 |
Aborting bisect early when the bug specified in the bisect config is closed.
Also, renaming valid_params and valid_parameters when validating bisect options
to required_params and required_parameters respectively to better reflect what
they actually are.
Fixing some runtime errors introduced by the refactoring to use ArgsParser
instead of OptionsParser.
BUG=424688
Review URL: https://codereview.chromium.org/697713003
Cr-Commit-Position: refs/heads/master@{#302468}
Diffstat (limited to 'tools/run-bisect-perf-regression.py')
-rwxr-xr-x | tools/run-bisect-perf-regression.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/tools/run-bisect-perf-regression.py b/tools/run-bisect-perf-regression.py index 815d957..4047f825 100755 --- a/tools/run-bisect-perf-regression.py +++ b/tools/run-bisect-perf-regression.py @@ -111,18 +111,18 @@ def _LoadConfigFile(config_file_path): return {} -def _ValidateConfigFile(config_contents, valid_parameters): +def _ValidateConfigFile(config_contents, required_parameters): """Validates the config file contents, checking whether all values are non-empty. Args: config_contents: A config dictionary. - valid_parameters: A list of parameters to check for. + required_parameters: A list of parameters to check for. Returns: True if valid. """ - for parameter in valid_parameters: + for parameter in required_parameters: if parameter not in config_contents: return False value = config_contents[parameter] @@ -146,13 +146,13 @@ def _ValidatePerfConfigFile(config_contents): Returns: True if valid. """ - valid_parameters = [ + required_parameters = [ 'command', 'repeat_count', 'truncate_percent', 'max_time_minutes', ] - return _ValidateConfigFile(config_contents, valid_parameters) + return _ValidateConfigFile(config_contents, required_parameters) def _ValidateBisectConfigFile(config_contents): @@ -167,7 +167,7 @@ def _ValidateBisectConfigFile(config_contents): Returns: True if valid. """ - valid_params = [ + required_params = [ 'command', 'good_revision', 'bad_revision', @@ -176,7 +176,7 @@ def _ValidateBisectConfigFile(config_contents): 'truncate_percent', 'max_time_minutes', ] - return _ValidateConfigFile(config_contents, valid_params) + return _ValidateConfigFile(config_contents, required_params) def _OutputFailedResults(text_to_print): @@ -210,6 +210,9 @@ def _CreateBisectOptionsFromConfig(config): if config.has_key('improvement_direction'): opts_dict['improvement_direction'] = int(config['improvement_direction']) + if config.has_key('bug_id') and str(config['bug_id']).isdigit(): + opts_dict['bug_id'] = config['bug_id'] + opts_dict['build_preference'] = 'ninja' opts_dict['output_buildbot_annotations'] = True @@ -409,6 +412,9 @@ def _RunBisectionScript( if config.has_key('improvement_direction'): cmd.extend(['-d', config['improvement_direction']]) + if config.has_key('bug_id'): + cmd.extend(['--bug_id', config['bug_id']]) + cmd.extend(['--build_preference', 'ninja']) if '--browser=cros' in config['command']: |