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' | |
41 BUILDBOT_BUILDERNAME = 'BUILDBOT_BUILDERNAME' | 40 BUILDBOT_BUILDERNAME = 'BUILDBOT_BUILDERNAME' |
42 BENCHMARKS_JSON_FILE = 'benchmarks.json' | 41 BENCHMARKS_JSON_FILE = 'benchmarks.json' |
43 | 42 |
44 class Goma(object): | 43 class Goma(object): |
45 | 44 |
46 def __init__(self, path_to_goma): | 45 def __init__(self, path_to_goma): |
47 self._abs_path_to_goma = None | 46 self._abs_path_to_goma = None |
48 self._abs_path_to_goma_file = None | 47 self._abs_path_to_goma_file = None |
49 if not path_to_goma: | 48 if not path_to_goma: |
50 return | 49 return |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 ['diff', '--no-ext-diff', '--name-only', 'HEAD~1'], cwd=cwd) | 627 ['diff', '--no-ext-diff', '--name-only', 'HEAD~1'], cwd=cwd) |
629 modified_files = log_output.split() | 628 modified_files = log_output.split() |
630 return modified_files | 629 return modified_files |
631 | 630 |
632 | 631 |
633 def _GetAffectedBenchmarkModuleNames(): | 632 def _GetAffectedBenchmarkModuleNames(): |
634 """Gets list of modified benchmark files under tools/perf/benchmarks.""" | 633 """Gets list of modified benchmark files under tools/perf/benchmarks.""" |
635 all_affected_files = _GetModifiedFilesFromPatch() | 634 all_affected_files = _GetModifiedFilesFromPatch() |
636 modified_benchmarks = [] | 635 modified_benchmarks = [] |
637 for affected_file in all_affected_files: | 636 for affected_file in all_affected_files: |
638 if (affected_file.startswith(PERF_BENCHMARKS_PATH) or | 637 if affected_file.startswith(PERF_BENCHMARKS_PATH): |
639 affected_file.startswith(PERF_MEASUREMENTS_PATH)): | |
640 benchmark = os.path.basename(os.path.splitext(affected_file)[0]) | 638 benchmark = os.path.basename(os.path.splitext(affected_file)[0]) |
641 modified_benchmarks.append(benchmark) | 639 modified_benchmarks.append(benchmark) |
642 return modified_benchmarks | 640 return modified_benchmarks |
643 | 641 |
644 | 642 |
645 def _ListAvailableBenchmarks(bot_platform): | 643 def _ListAvailableBenchmarks(bot_platform): |
646 """Gets all available benchmarks names as a list.""" | 644 """Gets all available benchmarks names as a list.""" |
647 browser_type = _GetBrowserType(bot_platform) | 645 browser_type = _GetBrowserType(bot_platform) |
648 if os.path.exists(BENCHMARKS_JSON_FILE): | 646 if os.path.exists(BENCHMARKS_JSON_FILE): |
649 os.remove(BENCHMARKS_JSON_FILE) | 647 os.remove(BENCHMARKS_JSON_FILE) |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 return _SetupAndRunPerformanceTest( | 855 return _SetupAndRunPerformanceTest( |
858 config={}, path_to_goma=opts.path_to_goma, is_cq_tryjob=True) | 856 config={}, path_to_goma=opts.path_to_goma, is_cq_tryjob=True) |
859 | 857 |
860 print ('Error: Could not load config file. Double check your changes to ' | 858 print ('Error: Could not load config file. Double check your changes to ' |
861 'auto_bisect/bisect.cfg or run-perf-test.cfg for syntax errors.\n') | 859 'auto_bisect/bisect.cfg or run-perf-test.cfg for syntax errors.\n') |
862 return 1 | 860 return 1 |
863 | 861 |
864 | 862 |
865 if __name__ == '__main__': | 863 if __name__ == '__main__': |
866 sys.exit(main()) | 864 sys.exit(main()) |
OLD | NEW |