Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Unified Diff: tools/testing/perf_testing/run_perf_tests.py

Issue 10391037: Fix dealing with incomplete files as the first set of files encountered. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698