| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import math | 8 import math |
| 9 import optparse | 9 import optparse |
| 10 import os | 10 import os |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 if os.path.exists(DART_REPO_LOC): | 91 if os.path.exists(DART_REPO_LOC): |
| 92 os.chdir(DART_REPO_LOC) | 92 os.chdir(DART_REPO_LOC) |
| 93 results, _ = self.RunCmd(['svn', 'st']) | 93 results, _ = self.RunCmd(['svn', 'st']) |
| 94 for line in results.split('\n'): | 94 for line in results.split('\n'): |
| 95 if line.startswith('?'): | 95 if line.startswith('?'): |
| 96 to_remove = line.split()[1] | 96 to_remove = line.split()[1] |
| 97 if os.path.isdir(to_remove): | 97 if os.path.isdir(to_remove): |
| 98 shutil.rmtree(to_remove)#, ignore_errors=True) | 98 shutil.rmtree(to_remove)#, ignore_errors=True) |
| 99 else: | 99 else: |
| 100 os.remove(to_remove) | 100 os.remove(to_remove) |
| 101 elif any(line.startswith(status) for status in ['A', 'M', 'C', 'D']): |
| 102 self.RunCmd(['svn', 'revert', line.split()[1]]) |
| 101 | 103 |
| 102 def GetArchive(self, archive_name): | 104 def GetArchive(self, archive_name): |
| 103 """Wrapper around the pulling down a specific archive from Google Storage. | 105 """Wrapper around the pulling down a specific archive from Google Storage. |
| 104 Adds a specific revision argument as needed. | 106 Adds a specific revision argument as needed. |
| 105 Returns: The stdout and stderr from running this command.""" | 107 Returns: The stdout and stderr from running this command.""" |
| 106 while True: | 108 while True: |
| 107 cmd = ['python', os.path.join(DART_REPO_LOC, 'tools', 'get_archive.py'), | 109 cmd = ['python', os.path.join(DART_REPO_LOC, 'tools', 'get_archive.py'), |
| 108 archive_name] | 110 archive_name] |
| 109 if int(self.current_revision_num) != -1: | 111 if int(self.current_revision_num) != -1: |
| 110 cmd += ['-r', str(self.current_revision_num)] | 112 cmd += ['-r', str(self.current_revision_num)] |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 def IsSafeFile(f): | 244 def IsSafeFile(f): |
| 243 if not any(f.startswith(prefix) for prefix in definitely_yes): | 245 if not any(f.startswith(prefix) for prefix in definitely_yes): |
| 244 return any(f.startswith(prefix) for prefix in no_effect) | 246 return any(f.startswith(prefix) for prefix in no_effect) |
| 245 return False | 247 return False |
| 246 return not all(IsSafeFile(f) for f in files_list) | 248 return not all(IsSafeFile(f) for f in files_list) |
| 247 | 249 |
| 248 if revision_num: | 250 if revision_num: |
| 249 return (HasPerfAffectingResults(GetFileList( | 251 return (HasPerfAffectingResults(GetFileList( |
| 250 revision_num)), revision_num) | 252 revision_num)), revision_num) |
| 251 else: | 253 else: |
| 252 results, _ = self.RunCmd(['svn', 'st', '-u'], std_in='p\r\n') | 254 latest_interesting_server_rev = None |
| 253 latest_interesting_server_rev = int(results.split('\n')[-2].split()[-1]) | 255 while not latest_interesting_server_rev: |
| 256 results, _ = self.RunCmd(['svn', 'st', '-u'], std_in='p\r\n') |
| 257 if len(results.split('\n')) >= 2: |
| 258 latest_interesting_server_rev = int( |
| 259 results.split('\n')[-2].split()[-1]) |
| 260 print 'success' |
| 261 else: |
| 262 print 'hrmmmm' |
| 254 if self.backfill: | 263 if self.backfill: |
| 255 done_cls = list(UpdateSetOfDoneCls()) | 264 done_cls = list(UpdateSetOfDoneCls()) |
| 256 done_cls.sort() | 265 done_cls.sort() |
| 257 if done_cls: | 266 if done_cls: |
| 258 last_done_cl = int(done_cls[-1]) | 267 last_done_cl = int(done_cls[-1]) |
| 259 else: | 268 else: |
| 260 last_done_cl = EARLIEST_REVISION | 269 last_done_cl = EARLIEST_REVISION |
| 261 while latest_interesting_server_rev >= last_done_cl: | 270 while latest_interesting_server_rev >= last_done_cl: |
| 262 file_list = GetFileList(latest_interesting_server_rev) | 271 file_list = GetFileList(latest_interesting_server_rev) |
| 263 if HasPerfAffectingResults(file_list): | 272 if HasPerfAffectingResults(file_list): |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 for extra_metric in extra_metrics: | 415 for extra_metric in extra_metrics: |
| 407 self.revision_dict[platform][f][extra_metric] = [] | 416 self.revision_dict[platform][f][extra_metric] = [] |
| 408 self.values_dict[platform][f][extra_metric] = [] | 417 self.values_dict[platform][f][extra_metric] = [] |
| 409 | 418 |
| 410 def IsValidCombination(self, platform, variant): | 419 def IsValidCombination(self, platform, variant): |
| 411 """Check whether data should be captured for this platform/variant | 420 """Check whether data should be captured for this platform/variant |
| 412 combination. | 421 combination. |
| 413 """ | 422 """ |
| 414 # TODO(vsm): This avoids a bug in 32-bit Chrome (dartium) | 423 # TODO(vsm): This avoids a bug in 32-bit Chrome (dartium) |
| 415 # running JS dromaeo. | 424 # running JS dromaeo. |
| 425 if variant == 'js': |
| 426 return False |
| 416 if platform == 'dartium' and variant == 'js': | 427 if platform == 'dartium' and variant == 'js': |
| 417 return False | 428 return False |
| 418 if (platform == 'safari' and variant == 'dart2js' and | 429 if (platform == 'safari' and variant == 'dart2js' and |
| 419 int(self.test_runner.current_revision_num) < 10193): | 430 int(self.test_runner.current_revision_num) < 10193): |
| 420 # In revision 10193 we fixed a bug that allows Safari 6 to run dart2js | 431 # In revision 10193 we fixed a bug that allows Safari 6 to run dart2js |
| 421 # code. Since we can't change the Safari version on the machine, we're | 432 # code. Since we can't change the Safari version on the machine, we're |
| 422 # just not running | 433 # just not running |
| 423 # for this case. | 434 # for this case. |
| 424 return False | 435 return False |
| 425 return True | 436 return True |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 '--out', file_path, '--browser', browser, | 658 '--out', file_path, '--browser', browser, |
| 648 '--timeout', '600', '--mode', 'perf'], self.test.trace_file, | 659 '--timeout', '600', '--mode', 'perf'], self.test.trace_file, |
| 649 append=True) | 660 append=True) |
| 650 | 661 |
| 651 class CommonBrowserFileProcessor(Processor): | 662 class CommonBrowserFileProcessor(Processor): |
| 652 | 663 |
| 653 def ProcessFile(self, afile, should_post_file): | 664 def ProcessFile(self, afile, should_post_file): |
| 654 """Comb through the html to find the performance results. | 665 """Comb through the html to find the performance results. |
| 655 Returns: True if we successfully posted our data to storage and/or we can | 666 Returns: True if we successfully posted our data to storage and/or we can |
| 656 delete the trace file.""" | 667 delete the trace file.""" |
| 668 print afile |
| 657 os.chdir(os.path.join(TOP_LEVEL_DIR, 'tools', | 669 os.chdir(os.path.join(TOP_LEVEL_DIR, 'tools', |
| 658 'testing', 'perf_testing')) | 670 'testing', 'perf_testing')) |
| 659 parts = afile.split('-') | 671 parts = afile.split('-') |
| 660 browser = parts[2] | 672 browser = parts[2] |
| 661 version = parts[3] | 673 version = parts[3] |
| 662 f = self.OpenTraceFile(afile, should_post_file) | 674 f = self.OpenTraceFile(afile, should_post_file) |
| 663 lines = f.readlines() | 675 lines = f.readlines() |
| 664 line = '' | 676 line = '' |
| 665 i = 0 | 677 i = 0 |
| 666 revision_num = 0 | 678 revision_num = 0 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 904 version = version.replace('frog', 'dart') | 916 version = version.replace('frog', 'dart') |
| 905 version = version.replace('_','AND') | 917 version = version.replace('_','AND') |
| 906 tags = DromaeoTester.GetValidDromaeoTags() | 918 tags = DromaeoTester.GetValidDromaeoTags() |
| 907 return 'OR'.join([ '%sAND%s' % (version, tag) for tag in tags]) | 919 return 'OR'.join([ '%sAND%s' % (version, tag) for tag in tags]) |
| 908 | 920 |
| 909 | 921 |
| 910 class DromaeoFileProcessor(Processor): | 922 class DromaeoFileProcessor(Processor): |
| 911 def ProcessFile(self, afile, should_post_file): | 923 def ProcessFile(self, afile, should_post_file): |
| 912 """Comb through the html to find the performance results. | 924 """Comb through the html to find the performance results. |
| 913 Returns: True if we successfully posted our data to storage.""" | 925 Returns: True if we successfully posted our data to storage.""" |
| 926 print afile |
| 914 parts = afile.split('-') | 927 parts = afile.split('-') |
| 915 browser = parts[2] | 928 browser = parts[2] |
| 916 version = parts[3] | 929 version = parts[3] |
| 917 | 930 |
| 918 bench_dict = self.test.values_dict[browser][version] | 931 bench_dict = self.test.values_dict[browser][version] |
| 919 | 932 |
| 920 f = self.OpenTraceFile(afile, should_post_file) | 933 f = self.OpenTraceFile(afile, should_post_file) |
| 921 lines = f.readlines() | 934 lines = f.readlines() |
| 922 i = 0 | 935 i = 0 |
| 923 revision_num = 0 | 936 revision_num = 0 |
| 924 revision_pattern = r'Revision: (\d+)' | 937 revision_pattern = r'Revision: (\d+)' |
| 925 suite_pattern = r'<div class="result-item done">(.+?)</ol></div>' | 938 suite_pattern = r'<div class="result-item done">(.+?)</ol></div>' |
| 926 result_pattern = r'<b>(.+?)</b>(.+?)<small> runs/s(.+)' | 939 result_pattern = r'<b>(.+?)</b>(.+?)<small> runs/s(.+)' |
| 927 | 940 |
| 928 upload_success = True | 941 upload_success = True |
| 929 for line in lines: | 942 for line in lines: |
| 930 rev = re.match(revision_pattern, line.strip()) | 943 rev = re.match(revision_pattern, line.strip().replace('"', '')) |
| 931 if rev: | 944 if rev: |
| 932 revision_num = int(rev.group(1)) | 945 revision_num = int(rev.group(1)) |
| 933 continue | 946 continue |
| 934 | 947 |
| 935 suite_results = re.findall(suite_pattern, line) | 948 suite_results = re.findall(suite_pattern, line) |
| 936 if suite_results: | 949 if suite_results: |
| 937 for suite_result in suite_results: | 950 for suite_result in suite_results: |
| 938 results = re.findall(r'<li>(.*?)</li>', suite_result) | 951 results = re.findall(r'<li>(.*?)</li>', suite_result) |
| 939 if results: | 952 if results: |
| 940 for result in results: | 953 for result in results: |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1117 else: | 1130 else: |
| 1118 if runner.backfill: | 1131 if runner.backfill: |
| 1119 results_set = FillInBackHistory(results_set, runner) | 1132 results_set = FillInBackHistory(results_set, runner) |
| 1120 else: | 1133 else: |
| 1121 time.sleep(200) | 1134 time.sleep(200) |
| 1122 else: | 1135 else: |
| 1123 runner.RunTestSequence() | 1136 runner.RunTestSequence() |
| 1124 | 1137 |
| 1125 if __name__ == '__main__': | 1138 if __name__ == '__main__': |
| 1126 main() | 1139 main() |
| OLD | NEW |