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