Chromium Code Reviews| Index: tools/testing/perf_testing/run_perf_tests.py |
| =================================================================== |
| --- tools/testing/perf_testing/run_perf_tests.py (revision 7470) |
| +++ tools/testing/perf_testing/run_perf_tests.py (working copy) |
| @@ -691,10 +691,10 @@ |
| parts = afile.split('-') |
| browser = parts[2] |
| version = parts[3] |
| - if should_post_file: |
| - f = open(os.path.join(self.test.result_folder_name, afile)) |
| - else: |
| - f = open(os.path.join('old', self.test.result_folder_name, afile)) |
| + file_path = os.path.join(self.test.result_folder_name, afile) |
|
vsm
2012/05/09 20:53:11
Consider refactoring into Processor base class.
Emily Fortuna
2012/05/09 20:57:07
Will do!
|
| + if not should_post_file: |
| + file_path = os.path.join('old', file_path) |
| + f = open(file_path) |
| lines = f.readlines() |
| line = '' |
| i = 0 |
| @@ -722,7 +722,7 @@ |
| for result in results: |
| name_and_score = result.split(':') |
| if len(name_and_score) < 2: |
| - break |
| + return True |
| name = name_and_score[0].strip() |
| score = name_and_score[1].strip() |
| if version == 'js' or version == 'v8': |
| @@ -882,7 +882,10 @@ |
| bench_dict = self.test.values_dict[browser][version] |
| - f = open(os.path.join(self.test.result_folder_name, afile)) |
| + file_path = os.path.join(self.test.result_folder_name, afile) |
| + if not should_post_file: |
| + file_path = os.path.join('old', file_path) |
| + f = open(file_path) |
| lines = f.readlines() |
| i = 0 |
| revision_num = 0 |
| @@ -1010,7 +1013,10 @@ |
| Returns: True if we successfully posted our data to storage.""" |
| os.chdir(os.path.join(DART_INSTALL_LOCATION, 'tools', |
| 'testing', 'perf_testing')) |
| - f = open(os.path.join(self.test.result_folder_name, afile)) |
| + file_path = os.path.join(self.test.result_folder_name, afile) |
| + if not should_post_file: |
| + file_path = os.path.join('old', file_path) |
| + f = open(file_path) |
| tabulate_data = False |
| revision_num = 0 |
| revision_pattern = r'Revision: (\d+)' |
| @@ -1139,7 +1145,10 @@ |
| Returns: True if we successfully posted our data to storage.""" |
| os.chdir(os.path.join(DART_INSTALL_LOCATION, 'tools', |
| 'testing', 'perf_testing')) |
| - f = open(os.path.join(self.test.result_folder_name, afile)) |
| + file_path = os.path.join(self.test.result_folder_name, afile) |
| + if not should_post_file: |
| + file_path = os.path.join('old', file_path) |
| + f = open(file_path) |
| tabulate_data = False |
| revision_num = 0 |
| upload_success = True |
| @@ -1171,15 +1180,20 @@ |
| upload_success = False |
| if revision_num != 0: |
| for metric in self.test.values_list: |
| - self.test.revision_dict['commandline']['frog'][metric].pop() |
| - self.test.revision_dict['commandline']['frog'][metric] += \ |
| - [revision_num] |
| - # Fill in 0 if compilation failed. |
| - if self.test.values_dict['commandline']['frog'][metric][-1] < \ |
| - self.test.failure_threshold[metric]: |
| - self.test.values_dict['commandline']['frog'][metric] += [0] |
| + try: |
| + self.test.revision_dict['commandline']['frog'][metric].pop() |
| self.test.revision_dict['commandline']['frog'][metric] += \ |
| [revision_num] |
| + # Fill in 0 if compilation failed. |
| + if self.test.values_dict['commandline']['frog'][metric][-1] < \ |
| + self.test.failure_threshold[metric]: |
| + self.test.values_dict['commandline']['frog'][metric] += [0] |
| + self.test.revision_dict['commandline']['frog'][metric] += \ |
| + [revision_num] |
| + except IndexError: |
| + # We tried to pop from an empty list. This happens if the first |
| + # trace file we encounter is incomplete. |
| + pass |
| f.close() |
| return upload_success |