| 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 try bot to run the bisect script with the parameters | 8 This script is used by a try bot to run the bisect script with the parameters |
| 9 specified in the bisect config file. It checks out a copy of the depot in | 9 specified in the bisect config file. It checks out a copy of the depot in |
| 10 a subdirectory 'bisect' of the working directory provided, annd runs the | 10 a subdirectory 'bisect' of the working directory provided, annd runs the |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 CROS_IP_ENV = 'BISECT_CROS_IP' | 30 CROS_IP_ENV = 'BISECT_CROS_IP' |
| 31 SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) | 31 SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__)) |
| 32 SRC_DIR = os.path.join(SCRIPT_DIR, os.path.pardir) | 32 SRC_DIR = os.path.join(SCRIPT_DIR, os.path.pardir) |
| 33 BISECT_CONFIG_PATH = os.path.join(SCRIPT_DIR, 'auto_bisect', 'bisect.cfg') | 33 BISECT_CONFIG_PATH = os.path.join(SCRIPT_DIR, 'auto_bisect', 'bisect.cfg') |
| 34 RUN_TEST_CONFIG_PATH = os.path.join(SCRIPT_DIR, 'run-perf-test.cfg') | 34 RUN_TEST_CONFIG_PATH = os.path.join(SCRIPT_DIR, 'run-perf-test.cfg') |
| 35 WEBKIT_RUN_TEST_CONFIG_PATH = os.path.join( | 35 WEBKIT_RUN_TEST_CONFIG_PATH = os.path.join( |
| 36 SRC_DIR, 'third_party', 'WebKit', 'Tools', 'run-perf-test.cfg') | 36 SRC_DIR, 'third_party', 'WebKit', 'Tools', 'run-perf-test.cfg') |
| 37 BISECT_SCRIPT_DIR = os.path.join(SCRIPT_DIR, 'auto_bisect') | 37 BISECT_SCRIPT_DIR = os.path.join(SCRIPT_DIR, 'auto_bisect') |
| 38 | 38 |
| 39 PERF_BENCHMARKS_PATH = 'tools/perf/benchmarks' | 39 PERF_BENCHMARKS_PATH = 'tools/perf/benchmarks' |
| 40 PERF_MEASUREMENTS_PATH = 'tools/perf/measurements' |
| 40 BUILDBOT_BUILDERNAME = 'BUILDBOT_BUILDERNAME' | 41 BUILDBOT_BUILDERNAME = 'BUILDBOT_BUILDERNAME' |
| 41 BENCHMARKS_JSON_FILE = 'benchmarks.json' | 42 BENCHMARKS_JSON_FILE = 'benchmarks.json' |
| 42 | 43 |
| 43 class Goma(object): | 44 class Goma(object): |
| 44 | 45 |
| 45 def __init__(self, path_to_goma): | 46 def __init__(self, path_to_goma): |
| 46 self._abs_path_to_goma = None | 47 self._abs_path_to_goma = None |
| 47 self._abs_path_to_goma_file = None | 48 self._abs_path_to_goma_file = None |
| 48 if not path_to_goma: | 49 if not path_to_goma: |
| 49 return | 50 return |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 ['diff', '--no-ext-diff', '--name-only', 'HEAD~1'], cwd=cwd) | 628 ['diff', '--no-ext-diff', '--name-only', 'HEAD~1'], cwd=cwd) |
| 628 modified_files = log_output.split() | 629 modified_files = log_output.split() |
| 629 return modified_files | 630 return modified_files |
| 630 | 631 |
| 631 | 632 |
| 632 def _GetAffectedBenchmarkModuleNames(): | 633 def _GetAffectedBenchmarkModuleNames(): |
| 633 """Gets list of modified benchmark files under tools/perf/benchmarks.""" | 634 """Gets list of modified benchmark files under tools/perf/benchmarks.""" |
| 634 all_affected_files = _GetModifiedFilesFromPatch() | 635 all_affected_files = _GetModifiedFilesFromPatch() |
| 635 modified_benchmarks = [] | 636 modified_benchmarks = [] |
| 636 for affected_file in all_affected_files: | 637 for affected_file in all_affected_files: |
| 637 if affected_file.startswith(PERF_BENCHMARKS_PATH): | 638 if (affected_file.startswith(PERF_BENCHMARKS_PATH) or |
| 639 affected_file.startswith(PERF_MEASUREMENTS_PATH)): |
| 638 benchmark = os.path.basename(os.path.splitext(affected_file)[0]) | 640 benchmark = os.path.basename(os.path.splitext(affected_file)[0]) |
| 639 modified_benchmarks.append(benchmark) | 641 modified_benchmarks.append(benchmark) |
| 640 return modified_benchmarks | 642 return modified_benchmarks |
| 641 | 643 |
| 642 | 644 |
| 643 def _ListAvailableBenchmarks(bot_platform): | 645 def _ListAvailableBenchmarks(bot_platform): |
| 644 """Gets all available benchmarks names as a list.""" | 646 """Gets all available benchmarks names as a list.""" |
| 645 browser_type = _GetBrowserType(bot_platform) | 647 browser_type = _GetBrowserType(bot_platform) |
| 646 if os.path.exists(BENCHMARKS_JSON_FILE): | 648 if os.path.exists(BENCHMARKS_JSON_FILE): |
| 647 os.remove(BENCHMARKS_JSON_FILE) | 649 os.remove(BENCHMARKS_JSON_FILE) |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 return _SetupAndRunPerformanceTest( | 857 return _SetupAndRunPerformanceTest( |
| 856 config={}, path_to_goma=opts.path_to_goma, is_cq_tryjob=True) | 858 config={}, path_to_goma=opts.path_to_goma, is_cq_tryjob=True) |
| 857 | 859 |
| 858 print ('Error: Could not load config file. Double check your changes to ' | 860 print ('Error: Could not load config file. Double check your changes to ' |
| 859 'auto_bisect/bisect.cfg or run-perf-test.cfg for syntax errors.\n') | 861 'auto_bisect/bisect.cfg or run-perf-test.cfg for syntax errors.\n') |
| 860 return 1 | 862 return 1 |
| 861 | 863 |
| 862 | 864 |
| 863 if __name__ == '__main__': | 865 if __name__ == '__main__': |
| 864 sys.exit(main()) | 866 sys.exit(main()) |
| OLD | NEW |