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

Side by Side Diff: tools/testing/perf_testing/run_perf_tests.py

Issue 199003005: Package-ify Dromaeo and browser controller functionality (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/testing/dart/perf_test_controller.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 if (not os.path.exists(os.path.join( 167 if (not os.path.exists(os.path.join(
168 DART_REPO_LOC, 'tools', 'get_archive.py')) or not success 168 DART_REPO_LOC, 'tools', 'get_archive.py')) or not success
169 or 'InvalidUriError' in stderr or "Couldn't download" in stdout or 169 or 'InvalidUriError' in stderr or "Couldn't download" in stdout or
170 'Unable to download' in stdout): 170 'Unable to download' in stdout):
171 # Couldn't find the SDK on Google Storage. Build it locally. 171 # Couldn't find the SDK on Google Storage. Build it locally.
172 172
173 # TODO(efortuna): Currently always building ia32 architecture because we 173 # TODO(efortuna): Currently always building ia32 architecture because we
174 # don't have test statistics for what's passing on x64. Eliminate arch 174 # don't have test statistics for what's passing on x64. Eliminate arch
175 # specification when we have tests running on x64, too. 175 # specification when we have tests running on x64, too.
176 shutil.rmtree(os.path.join(os.getcwd(), 176 shutil.rmtree(os.path.join(os.getcwd(),
177 utils.GetBuildRoot(utils.GuessOS(), 'release', 'ia32')), 177 utils.GetBuildRoot(utils.GuessOS())),
178 onerror=TestRunner._OnRmError) 178 onerror=TestRunner._OnRmError)
179 lines = self.RunCmd([os.path.join('.', 'tools', 'build.py'), '-m', 179 lines = self.RunCmd([os.path.join('.', 'tools', 'build.py'), '-m',
180 'release', '--arch=ia32', 'create_sdk']) 180 'release', '--arch=ia32', 'create_sdk'])
181 181
182 for line in lines: 182 for line in lines:
183 if 'BUILD FAILED' in line: 183 if 'BUILD FAILED' in line:
184 # Someone checked in a broken build! Stop trying to make it work 184 # Someone checked in a broken build! Stop trying to make it work
185 # and wait to try again. 185 # and wait to try again.
186 print 'Broken Build' 186 print 'Broken Build'
187 return 1 187 return 1
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 714
715 class DromaeoPerfTester(DromaeoTester): 715 class DromaeoPerfTester(DromaeoTester):
716 def RunTests(self): 716 def RunTests(self):
717 """Run dromaeo in the browser.""" 717 """Run dromaeo in the browser."""
718 success, _, _ = self.test.test_runner.GetArchive('dartium') 718 success, _, _ = self.test.test_runner.GetArchive('dartium')
719 if not success: 719 if not success:
720 # Unable to download dartium. Try later. 720 # Unable to download dartium. Try later.
721 return 721 return
722 722
723 # Build tests. 723 # Build tests.
724 dromaeo_path = os.path.join('samples', 'third_party', 'dromaeo') 724 # TODO(efortuna): Make the pub functionality a separate function.
725 current_path = os.getcwd() 725 current_path = os.getcwd()
726 os.chdir(dromaeo_path) 726 os.chdir(os.path.join(DART_REPO_LOC, 'samples', 'third_party',
727 stdout, _ = self.test.test_runner.RunCmd( 727 'dromaeo'))
728 ['python', 'generate_perf_and_dart2js_tests.py']) 728 self.test.test_runner.RunCmd([os.path.join(DART_REPO_LOC,
729 utils.GetBuildRoot(utils.GuessOS(), 'release', 'ia32'),
730 'dart-sdk', 'bin', 'pub'), 'install']) # TODO: pub upgrade?
731 stdout, _ = self.test.test_runner.RunCmd([os.path.join(DART_REPO_LOC,
732 utils.GetBuildRoot(utils.GuessOS(), 'release', 'ia32'),
733 'dart-sdk', 'bin', 'pub'), 'build'])
729 os.chdir(current_path) 734 os.chdir(current_path)
730 if 'Error: Compilation failed' in stdout: 735 if 'failed' in stdout:
731 return 736 return
737
732 versions = DromaeoTester.GetDromaeoVersions() 738 versions = DromaeoTester.GetDromaeoVersions()
733 739
734 for browser in BrowserTester.GetBrowsers(): 740 for browser in BrowserTester.GetBrowsers():
735 for version_name in versions: 741 for version_name in versions:
736 if not self.test.IsValidCombination(browser, version_name): 742 if not self.test.IsValidCombination(browser, version_name):
737 continue 743 continue
738 version = DromaeoTest.DromaeoPerfTester.GetDromaeoUrlQuery( 744 version = DromaeoTest.DromaeoPerfTester.GetDromaeoUrlQuery(
739 browser, version_name) 745 browser, version_name)
740 self.test.trace_file = os.path.join(TOP_LEVEL_DIR, 746 self.test.trace_file = os.path.join(TOP_LEVEL_DIR,
741 'tools', 'testing', 'perf_testing', self.test.result_folder_name, 747 'tools', 'testing', 'perf_testing', self.test.result_folder_name,
742 'dromaeo-%s-%s-%s' % (self.test.cur_time, browser, version_name)) 748 'dromaeo-%s-%s-%s' % (self.test.cur_time, browser, version_name))
743 self.AddSvnRevisionToTrace(self.test.trace_file, browser) 749 self.AddSvnRevisionToTrace(self.test.trace_file, browser)
744 url_path = '/'.join(['/root_dart', dromaeo_path, 'index%s.html?%s'% ( 750 url_path = '/'.join(['/code_root', 'build', 'web', 'index%s.html?%s'%(
745 '-dart' if version_name == 'dart_html' else '-js', 751 '-dart' if version_name == 'dart_html' else '-js',
746 version)]) 752 version)])
747 753
748 # TODO(efortuna): Make this a separate function. We should do this
749 # once per cycle.
750 os.chdir(os.path.join(DART_REPO_LOC, 'tools', 'testing', 'dart',
751 'browser_perf_testing'))
752 self.test.test_runner.RunCmd([os.path.join(DART_REPO_LOC,
753 utils.GetBuildRoot(utils.GuessOS(), 'release', 'ia32'),
754 'dart-sdk', 'bin', 'pub'), 'install'])
755 os.chdir(current_path)
756
757 self.test.test_runner.RunCmd( 754 self.test.test_runner.RunCmd(
758 [os.path.join(utils.GetBuildRoot( 755 [os.path.join(DART_REPO_LOC, utils.GetBuildRoot(
759 utils.GuessOS(), 'release', 'ia32'), 'dart-sdk', 'bin', 'dart'), 756 utils.GuessOS(), 'release', 'ia32'), 'dart-sdk', 'bin', 'dart'),
760 '--package-root=%s' % os.path.join(DART_REPO_LOC, 'tools', 757 '--package-root=%s' % os.path.join(DART_REPO_LOC, 'samples',
761 'testing', 'dart', 'browser_perf_testing', 'packages'), 758 'third_party', 'dromaeo', 'packages'), os.path.join(
762 os.path.join('tools', 'testing', 'dart', 'browser_perf_testing', 759 DART_REPO_LOC, 'samples', 'third_party', 'dromaeo', 'packages',
763 'lib', 'browser_perf_testing.dart'), 760 'browser_controller', 'browser_perf_testing.dart'),
764 '--browser', browser, '--termination_test_file', 761 '--browser', browser,
765 '/root_dart/samples/third_party/dromaeo/dromaeo_end_condition.' 762 '--test_path', url_path], self.test.trace_file,
766 'js', '--test_path', url_path], self.test.trace_file,
767 append=True) 763 append=True)
768 764
769 @staticmethod 765 @staticmethod
770 def GetDromaeoUrlQuery(browser, version): 766 def GetDromaeoUrlQuery(browser, version):
771 version = version.replace('_','AND') 767 version = version.replace('_','AND')
772 tags = DromaeoTester.GetValidDromaeoTags() 768 tags = DromaeoTester.GetValidDromaeoTags()
773 return 'OR'.join([ '%sAND%s' % (version, tag) for tag in tags]) 769 return 'OR'.join([ '%sAND%s' % (version, tag) for tag in tags])
774 770
775 771
776 class DromaeoFileProcessor(Processor): 772 class DromaeoFileProcessor(Processor):
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 else: 949 else:
954 if runner.backfill: 950 if runner.backfill:
955 results_set = FillInBackHistory(results_set, runner) 951 results_set = FillInBackHistory(results_set, runner)
956 else: 952 else:
957 time.sleep(200) 953 time.sleep(200)
958 else: 954 else:
959 runner.RunTestSequence() 955 runner.RunTestSequence()
960 956
961 if __name__ == '__main__': 957 if __name__ == '__main__':
962 main() 958 main()
OLDNEW
« no previous file with comments | « tools/testing/dart/perf_test_controller.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698