| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Run Performance Test Bisect Tool | 6 """Run Performance Test Bisect Tool |
| 7 | 7 |
| 8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py | 8 This script is used by a trybot to run the src/tools/bisect-perf-regression.py |
| 9 script with the parameters specified in run-bisect-perf-regression.cfg. It will | 9 script with the parameters specified in run-bisect-perf-regression.cfg. It will |
| 10 check out a copy of the depot in a subdirectory 'bisect' of the working | 10 check out a copy of the depot in a subdirectory 'bisect' of the working |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 175 |
| 176 def _OutputFailedResults(text_to_print): | 176 def _OutputFailedResults(text_to_print): |
| 177 bisect_utils.OutputAnnotationStepStart('Results - Failed') | 177 bisect_utils.OutputAnnotationStepStart('Results - Failed') |
| 178 print | 178 print |
| 179 print text_to_print | 179 print text_to_print |
| 180 print | 180 print |
| 181 bisect_utils.OutputAnnotationStepClosed() | 181 bisect_utils.OutputAnnotationStepClosed() |
| 182 | 182 |
| 183 | 183 |
| 184 def _CreateBisectOptionsFromConfig(config): | 184 def _CreateBisectOptionsFromConfig(config): |
| 185 print config['command'] |
| 185 opts_dict = {} | 186 opts_dict = {} |
| 186 opts_dict['command'] = config['command'] | 187 opts_dict['command'] = config['command'] |
| 187 opts_dict['metric'] = config['metric'] | 188 opts_dict['metric'] = config['metric'] |
| 188 | 189 |
| 189 if config['repeat_count']: | 190 if config['repeat_count']: |
| 190 opts_dict['repeat_test_count'] = int(config['repeat_count']) | 191 opts_dict['repeat_test_count'] = int(config['repeat_count']) |
| 191 | 192 |
| 192 if config['truncate_percent']: | 193 if config['truncate_percent']: |
| 193 opts_dict['truncate_percent'] = int(config['truncate_percent']) | 194 opts_dict['truncate_percent'] = int(config['truncate_percent']) |
| 194 | 195 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 206 if '--browser=cros' in config['command']: | 207 if '--browser=cros' in config['command']: |
| 207 opts_dict['target_platform'] = 'cros' | 208 opts_dict['target_platform'] = 'cros' |
| 208 | 209 |
| 209 if os.environ[CROS_BOARD_ENV] and os.environ[CROS_IP_ENV]: | 210 if os.environ[CROS_BOARD_ENV] and os.environ[CROS_IP_ENV]: |
| 210 opts_dict['cros_board'] = os.environ[CROS_BOARD_ENV] | 211 opts_dict['cros_board'] = os.environ[CROS_BOARD_ENV] |
| 211 opts_dict['cros_remote_ip'] = os.environ[CROS_IP_ENV] | 212 opts_dict['cros_remote_ip'] = os.environ[CROS_IP_ENV] |
| 212 else: | 213 else: |
| 213 raise RuntimeError('Cros build selected, but BISECT_CROS_IP or' | 214 raise RuntimeError('Cros build selected, but BISECT_CROS_IP or' |
| 214 'BISECT_CROS_BOARD undefined.') | 215 'BISECT_CROS_BOARD undefined.') |
| 215 elif 'android' in config['command']: | 216 elif 'android' in config['command']: |
| 216 if 'android-chrome' in config['command']: | 217 if 'android-chrome-shell' in config['command']: |
| 218 opts_dict['target_platform'] = 'android' |
| 219 elif 'android-chrome' in config['command']: |
| 217 opts_dict['target_platform'] = 'android-chrome' | 220 opts_dict['target_platform'] = 'android-chrome' |
| 218 else: | 221 else: |
| 219 opts_dict['target_platform'] = 'android' | 222 opts_dict['target_platform'] = 'android' |
| 220 | 223 |
| 221 return bisect.BisectOptions.FromDict(opts_dict) | 224 return bisect.BisectOptions.FromDict(opts_dict) |
| 222 | 225 |
| 223 | 226 |
| 224 def _RunPerformanceTest(config, path_to_file): | 227 def _RunPerformanceTest(config, path_to_file): |
| 225 # Bisect script expects to be run from src | 228 # Bisect script expects to be run from src |
| 226 os.chdir(os.path.join(path_to_file, '..')) | 229 os.chdir(os.path.join(path_to_file, '..')) |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 if os.environ[CROS_BOARD_ENV] and os.environ[CROS_IP_ENV]: | 386 if os.environ[CROS_BOARD_ENV] and os.environ[CROS_IP_ENV]: |
| 384 cmd.extend(['--cros_board', os.environ[CROS_BOARD_ENV]]) | 387 cmd.extend(['--cros_board', os.environ[CROS_BOARD_ENV]]) |
| 385 cmd.extend(['--cros_remote_ip', os.environ[CROS_IP_ENV]]) | 388 cmd.extend(['--cros_remote_ip', os.environ[CROS_IP_ENV]]) |
| 386 else: | 389 else: |
| 387 print 'Error: Cros build selected, but BISECT_CROS_IP or'\ | 390 print 'Error: Cros build selected, but BISECT_CROS_IP or'\ |
| 388 'BISECT_CROS_BOARD undefined.' | 391 'BISECT_CROS_BOARD undefined.' |
| 389 print | 392 print |
| 390 return 1 | 393 return 1 |
| 391 | 394 |
| 392 if 'android' in config['command']: | 395 if 'android' in config['command']: |
| 393 if 'android-chrome' in config['command']: | 396 if 'android-chrome-shell' in config['command']: |
| 397 cmd.extend(['--target_platform', 'android']) |
| 398 elif 'android-chrome' in config['command']: |
| 394 cmd.extend(['--target_platform', 'android-chrome']) | 399 cmd.extend(['--target_platform', 'android-chrome']) |
| 395 else: | 400 else: |
| 396 cmd.extend(['--target_platform', 'android']) | 401 cmd.extend(['--target_platform', 'android']) |
| 397 | 402 |
| 398 if path_to_goma: | 403 if path_to_goma: |
| 399 # crbug.com/330900. For Windows XP platforms, GOMA service is not supported. | 404 # crbug.com/330900. For Windows XP platforms, GOMA service is not supported. |
| 400 # Moreover we don't compile chrome when gs_bucket flag is set instead | 405 # Moreover we don't compile chrome when gs_bucket flag is set instead |
| 401 # use builds archives, therefore ignore GOMA service for Windows XP. | 406 # use builds archives, therefore ignore GOMA service for Windows XP. |
| 402 if config.get('gs_bucket') and platform.release() == 'XP': | 407 if config.get('gs_bucket') and platform.release() == 'XP': |
| 403 print ('Goma doesn\'t have a win32 binary, therefore it is not supported ' | 408 print ('Goma doesn\'t have a win32 binary, therefore it is not supported ' |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 opts.path_to_goma) | 520 opts.path_to_goma) |
| 516 | 521 |
| 517 print 'Error: Could not load config file. Double check your changes to '\ | 522 print 'Error: Could not load config file. Double check your changes to '\ |
| 518 'run-bisect-perf-regression.cfg/run-perf-test.cfg for syntax errors.' | 523 'run-bisect-perf-regression.cfg/run-perf-test.cfg for syntax errors.' |
| 519 print | 524 print |
| 520 return 1 | 525 return 1 |
| 521 | 526 |
| 522 | 527 |
| 523 if __name__ == '__main__': | 528 if __name__ == '__main__': |
| 524 sys.exit(main()) | 529 sys.exit(main()) |
| OLD | NEW |