Chromium Code Reviews| Index: tools/testing/perf_testing/run_perf_tests.py |
| diff --git a/tools/testing/perf_testing/run_perf_tests.py b/tools/testing/perf_testing/run_perf_tests.py |
| index 67b0052a3c3c5efbf03bc642663adcc5bb503162..1b9d8a8d456d706c4be6672ff85a5eae8de9e7f7 100755 |
| --- a/tools/testing/perf_testing/run_perf_tests.py |
| +++ b/tools/testing/perf_testing/run_perf_tests.py |
| @@ -384,7 +384,7 @@ class Tester(object): |
| """Perform any initial setup required before the test is run.""" |
| pass |
| - def add_svn_revision_to_trace(self, outfile): |
| + def add_svn_revision_to_trace(self, outfile, browser = None): |
| """Add the svn version number to the provided tracefile.""" |
| def search_for_revision(svn_info_command): |
| p = subprocess.Popen(svn_info_command, stdout = subprocess.PIPE, |
| @@ -397,7 +397,18 @@ class Tester(object): |
| return True |
| return False |
| - if not search_for_revision(['svn', 'info']): |
| + def get_dartium_revision(): |
| + version_file_name = os.path.join(DART_INSTALL_LOCATION, 'client', 'tests', |
| + 'dartium', 'LAST_VERSION') |
| + version_file = open(version_file_name, 'r') |
| + version = version_file.read().split('.')[-2] |
| + version_file.close() |
| + return version |
| + |
| + if browser and browser == 'dartium': |
| + revision = get_dartium_revision() |
| + self.test.test_runner.run_cmd(['echo', 'Revision: ' + revision], outfile) |
|
Emily Fortuna
2012/04/16 19:22:15
Do you want to print out a slightly different outp
|
| + elif not search_for_revision(['svn', 'info']): |
| if not search_for_revision(['git', 'svn', 'info']): |
| self.test.test_runner.run_cmd(['echo', 'Revision: unknown'], outfile) |
| @@ -419,8 +430,11 @@ class Processor(object): |
| given two benchmark dictionaries.""" |
| geo_mean = 0 |
| for benchmark in self.test.values_list: |
| - geo_mean += math.log(self.test.values_dict[platform][variant][benchmark][ |
| - len(self.test.values_dict[platform][variant][benchmark]) - 1]) |
| + try: |
| + geo_mean += math.log(self.test.values_dict[platform][variant][benchmark][ |
|
Emily Fortuna
2012/04/16 19:22:15
Also, why add the try/pass? If you're getting an e
vsm
2012/04/16 20:41:08
Ahh, I meant to clean this up. Because we're skip
Emily Fortuna
2012/04/16 20:50:17
That can work.
vsm
2012/04/16 22:02:58
Done. PTAL.
On 2012/04/16 20:50:17, Emily Fortuna
|
| + len(self.test.values_dict[platform][variant][benchmark]) - 1]) |
| + except IndexError: |
| + pass |
| self.test.values_dict[platform][variant]['Geo-Mean'] += \ |
| [math.pow(math.e, geo_mean / len(self.test.values_list))] |
| @@ -654,14 +668,23 @@ class CommonCommandLineTest(RuntimePerformanceTest): |
| class BrowserTester(Tester): |
| - # TODO(vsm): Add Dartium. |
| @staticmethod |
| def get_browsers(): |
| - browsers = ['ff', 'chrome'] |
| + browsers = ['dartium', 'ff', 'chrome'] |
| + has_shell = False |
| if platform.system() == 'Darwin': |
| browsers += ['safari'] |
| if platform.system() == 'Windows': |
| browsers += ['ie'] |
| + has_shell = True |
| + if 'dartium' in browsers: |
| + # Fetch it if necessary. |
| + get_dartium = ['python', |
| + os.path.join(DART_INSTALL_LOCATION, 'tools', 'get_drt.py'), |
| + '--dartium'] |
| + # TODO(vsm): It's inconvenient that run_cmd isn't in scope here. |
| + # Perhaps there is a better place to put that or this. |
| + subprocess.Popen(get_dartium, shell=has_shell) |
| return browsers |
| @@ -703,7 +726,7 @@ class CommonBrowserTest(RuntimePerformanceTest): |
| self.test.trace_file = os.path.join( |
| 'tools', 'testing', 'perf_testing', self.test.result_folder_name, |
| 'perf-%s-%s-%s' % (self.test.cur_time, browser, version)) |
| - self.add_svn_revision_to_trace(self.test.trace_file) |
| + self.add_svn_revision_to_trace(self.test.trace_file, browser) |
| file_path = os.path.join( |
| os.getcwd(), 'internal', 'browserBenchmarks', |
| 'benchmark_page_%s.html' % version) |
| @@ -859,12 +882,16 @@ class DromaeoTest(RuntimePerformanceTest): |
| for browser in BrowserTester.get_browsers(): |
| for version_name in versions: |
| + if browser == 'dartium' and version_name == 'js': |
| + # TODO(vsm): This avoids a bug in 32-bit Chrome (dartium) |
| + # running JS dromaeo. |
| + continue |
| version = DromaeoTest.DromaeoPerfTester.get_dromaeo_url_query( |
| - version_name) |
| + browser, version_name) |
| self.test.trace_file = os.path.join( |
| 'tools', 'testing', 'perf_testing', self.test.result_folder_name, |
| 'dromaeo-%s-%s-%s' % (self.test.cur_time, browser, version_name)) |
| - self.add_svn_revision_to_trace(self.test.trace_file) |
| + self.add_svn_revision_to_trace(self.test.trace_file, browser) |
| file_path = os.path.join(os.getcwd(), dromaeo_path, |
| 'index-js.html?%s' % version) |
| self.test.test_runner.run_cmd( |
| @@ -874,7 +901,9 @@ class DromaeoTest(RuntimePerformanceTest): |
| append=True) |
| @staticmethod |
| - def get_dromaeo_url_query(version): |
| + def get_dromaeo_url_query(browser, version): |
| + if browser == 'dartium': |
| + version = version.replace('frog', 'dart') |
| version = version.replace('_','&') |
| tags = DromaeoTester.get_valid_dromaeo_tags() |
| return '|'.join([ '%s&%s' % (version, tag) for tag in tags]) |