| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 os.chdir(DART_REPO_LOC) | 87 os.chdir(DART_REPO_LOC) |
| 88 results, _ = self.run_cmd(['svn', 'st']) | 88 results, _ = self.run_cmd(['svn', 'st']) |
| 89 for line in results.split('\n'): | 89 for line in results.split('\n'): |
| 90 if line.startswith('?'): | 90 if line.startswith('?'): |
| 91 to_remove = line.split()[1] | 91 to_remove = line.split()[1] |
| 92 if os.path.isdir(to_remove): | 92 if os.path.isdir(to_remove): |
| 93 shutil.rmtree(to_remove)#, ignore_errors=True) | 93 shutil.rmtree(to_remove)#, ignore_errors=True) |
| 94 else: | 94 else: |
| 95 os.remove(to_remove) | 95 os.remove(to_remove) |
| 96 | 96 |
| 97 def get_archive(archive_name): |
| 98 """Wrapper around the pulling down a specific archive from Google Storage. |
| 99 Adds a specific revision argument as needed. |
| 100 Returns: The stderr from running this command.""" |
| 101 cmd = ['python', os.path.join(DART_REPO_LOC, 'tools', 'get_archive.py'), |
| 102 archive_name] |
| 103 if self.current_revision_num != -1: |
| 104 cmd += ['-r', revision_num] |
| 105 _, stderr = self.test.test_runner.run_cmd(cmd) |
| 106 return stderr |
| 107 |
| 97 def sync_and_build(self, suites, revision_num=''): | 108 def sync_and_build(self, suites, revision_num=''): |
| 98 """Make sure we have the latest version of of the repo, and build it. We | 109 """Make sure we have the latest version of of the repo, and build it. We |
| 99 begin and end standing in DART_REPO_LOC. | 110 begin and end standing in DART_REPO_LOC. |
| 100 | 111 |
| 101 Args: | 112 Args: |
| 102 suites: The set of suites that we wish to build. | 113 suites: The set of suites that we wish to build. |
| 103 | 114 |
| 104 Returns: | 115 Returns: |
| 105 err_code = 1 if there was a problem building.""" | 116 err_code = 1 if there was a problem building.""" |
| 106 os.chdir(dirname(DART_REPO_LOC)) | 117 os.chdir(dirname(DART_REPO_LOC)) |
| 107 self.clear_out_unversioned_files() | 118 self.clear_out_unversioned_files() |
| 108 if revision_num == '': | 119 if revision_num == '': |
| 109 self.run_cmd(['gclient', 'sync']) | 120 self.run_cmd(['gclient', 'sync']) |
| 110 else: | 121 else: |
| 111 self.run_cmd(['gclient', 'sync', '-r', revision_num, '-t']) | 122 self.run_cmd(['gclient', 'sync', '-r', revision_num, '-t']) |
| 112 | 123 |
| 113 shutil.copytree(os.path.join(TOP_LEVEL_DIR, 'internal'), | 124 shutil.copytree(os.path.join(TOP_LEVEL_DIR, 'internal'), |
| 114 os.path.join(DART_REPO_LOC, 'internal')) | 125 os.path.join(DART_REPO_LOC, 'internal')) |
| 115 shutil.copy(os.path.join(TOP_LEVEL_DIR, 'tools', 'get_archive.py'), | 126 shutil.copy(os.path.join(TOP_LEVEL_DIR, 'tools', 'get_archive.py'), |
| 116 os.path.join(DART_REPO_LOC, 'tools', 'get_archive.py')) | 127 os.path.join(DART_REPO_LOC, 'tools', 'get_archive.py')) |
| 128 shutil.copy( |
| 129 os.path.join(TOP_LEVEL_DIR, 'tools', 'testing', 'run_selenium.py'), |
| 130 os.path.join(DART_REPO_LOC, 'tools', 'testing', 'run_selenium.py')) |
| 117 | 131 |
| 118 if revision_num == '': | 132 if revision_num == '': |
| 119 revision_num = search_for_revision(['svn', 'info']) | 133 revision_num = search_for_revision(['svn', 'info']) |
| 120 if revision_num == -1: | 134 if revision_num == -1: |
| 121 revision_num = search_for_revision(['git', 'svn', 'info']) | 135 revision_num = search_for_revision(['git', 'svn', 'info']) |
| 122 | 136 |
| 123 get_archive_path = os.path.join(DART_REPO_LOC, 'tools', 'get_archive.py') | 137 self.current_revision_num = revision_num |
| 124 if os.path.exists(get_archive_path): | 138 stderr = get_archive('sdk') |
| 125 cmd = ['python', get_archive_path, 'sdk'] | |
| 126 if revision_num != -1: | |
| 127 cmd += ['-r', revision_num] | |
| 128 _, stderr = self.run_cmd(cmd) | |
| 129 if not os.path.exists(get_archive_path) or 'InvalidUriError' in stderr: | 139 if not os.path.exists(get_archive_path) or 'InvalidUriError' in stderr: |
| 130 # Couldn't find the SDK on Google Storage. Build it locally. | 140 # Couldn't find the SDK on Google Storage. Build it locally. |
| 131 | 141 |
| 132 # On Windows, the output directory is marked as "Read Only," which causes | 142 # On Windows, the output directory is marked as "Read Only," which causes |
| 133 # an error to be thrown when we use shutil.rmtree. This helper function | 143 # an error to be thrown when we use shutil.rmtree. This helper function |
| 134 # changes the permissions so we can still delete the directory. | 144 # changes the permissions so we can still delete the directory. |
| 135 def on_rm_error(func, path, exc_info): | 145 def on_rm_error(func, path, exc_info): |
| 136 if os.path.exists(path): | 146 if os.path.exists(path): |
| 137 os.chmod(path, stat.S_IWRITE) | 147 os.chmod(path, stat.S_IWRITE) |
| 138 os.unlink(path) | 148 os.unlink(path) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 160 Args: | 170 Args: |
| 161 dir_name: the directory we will create if it does not exist.""" | 171 dir_name: the directory we will create if it does not exist.""" |
| 162 dir_path = os.path.join(TOP_LEVEL_DIR, 'tools', | 172 dir_path = os.path.join(TOP_LEVEL_DIR, 'tools', |
| 163 'testing', 'perf_testing', dir_name) | 173 'testing', 'perf_testing', dir_name) |
| 164 if not os.path.exists(dir_path): | 174 if not os.path.exists(dir_path): |
| 165 os.makedirs(dir_path) | 175 os.makedirs(dir_path) |
| 166 print 'Creating output directory ', dir_path | 176 print 'Creating output directory ', dir_path |
| 167 | 177 |
| 168 def has_new_code(self): | 178 def has_new_code(self): |
| 169 """Tests if there are any newer versions of files on the server.""" | 179 """Tests if there are any newer versions of files on the server.""" |
| 180 if not os.path.exists(DART_REPO_LOC): |
| 181 return True |
| 170 os.chdir(DART_REPO_LOC) | 182 os.chdir(DART_REPO_LOC) |
| 171 # Pass 'p' in if we have a new certificate for the svn server, we want to | 183 # Pass 'p' in if we have a new certificate for the svn server, we want to |
| 172 # (p)ermanently accept it. | 184 # (p)ermanently accept it. |
| 173 results, _ = self.run_cmd(['svn', 'st', '-u'], std_in='p\r\n') | 185 results, _ = self.run_cmd(['svn', 'st', '-u'], std_in='p\r\n') |
| 174 for line in results: | 186 for line in results: |
| 175 if '*' in line: | 187 if '*' in line: |
| 176 return True | 188 return True |
| 177 return False | 189 return False |
| 178 | 190 |
| 179 def get_os_directory(self): | 191 def get_os_directory(self): |
| 180 """Specifies the name of the directory for the testing build of dart, which | 192 """Specifies the name of the directory for the testing build of dart, which |
| 181 has yet a different naming convention from utils.getBuildRoot(...).""" | 193 has yet a different naming convention from utils.getBuildRoot(...).""" |
| 182 if platform.system() == 'Windows': | 194 if platform.system() == 'Windows': |
| 183 return 'windows' | 195 return 'windows' |
| 184 elif platform.system() == 'Darwin': | 196 elif platform.system() == 'Darwin': |
| 185 return 'macos' | 197 return 'macos' |
| 186 else: | 198 else: |
| 187 return 'linux' | 199 return 'linux' |
| 188 | 200 |
| 189 def parse_args(self): | 201 def parse_args(self): |
| 190 parser = optparse.OptionParser() | 202 parser = optparse.OptionParser() |
| 191 parser.add_option('--suites', '-s', dest='suites', help='Run the specified ' | 203 parser.add_option('--suites', '-s', dest='suites', help='Run the specified ' |
| 192 'comma-separated test suites from set: %s' % \ | 204 'comma-separated test suites from set: %s' % \ |
| 193 ','.join(TestBuilder.available_suite_names()), | 205 ','.join(TestBuilder.available_suite_names()), |
| 194 action='store', default=None) | 206 action='store', default=None) |
| 195 parser.add_option('--forever', '-f', dest='continuous', help='Run this scri' | 207 parser.add_option('--forever', '-f', dest='continuous', help='Run this scri' |
| 196 'pt forever, always checking for the next svn checkin', | 208 'pt forever, always checking for the next svn checkin', |
| 197 action='store_true', default=False) | 209 action='store_true', default=False) |
| 198 parser.add_option('--incremental', '-i', dest='incremental', | |
| 199 help='Start an an early revision and work your way ' | |
| 200 'forward through CLs sequentially', action='store_true', | |
| 201 default=False) | |
| 202 parser.add_option('--nobuild', '-n', dest='no_build', action='store_true', | 210 parser.add_option('--nobuild', '-n', dest='no_build', action='store_true', |
| 203 help='Do not sync with the repository and do not ' | 211 help='Do not sync with the repository and do not ' |
| 204 'rebuild.', default=False) | 212 'rebuild.', default=False) |
| 205 parser.add_option('--noupload', '-u', dest='no_upload', action='store_true', | 213 parser.add_option('--noupload', '-u', dest='no_upload', action='store_true', |
| 206 help='Do not post the results of the run.', default=False) | 214 help='Do not post the results of the run.', default=False) |
| 207 parser.add_option('--notest', '-t', dest='no_test', action='store_true', | 215 parser.add_option('--notest', '-t', dest='no_test', action='store_true', |
| 208 help='Do not run the tests.', default=False) | 216 help='Do not run the tests.', default=False) |
| 209 parser.add_option('--verbose', '-v', dest='verbose', help='Print extra ' | 217 parser.add_option('--verbose', '-v', dest='verbose', help='Print extra ' |
| 210 'debug output', action='store_true', default=False) | 218 'debug output', action='store_true', default=False) |
| 211 | 219 |
| 212 args, ignored = parser.parse_args() | 220 args, ignored = parser.parse_args() |
| 213 | 221 |
| 214 if not args.suites: | 222 if not args.suites: |
| 215 suites = TestBuilder.available_suite_names() | 223 suites = TestBuilder.available_suite_names() |
| 216 else: | 224 else: |
| 217 suites = [] | 225 suites = [] |
| 218 suitelist = args.suites.split(',') | 226 suitelist = args.suites.split(',') |
| 219 for name in suitelist: | 227 for name in suitelist: |
| 220 if name in TestBuilder.available_suite_names(): | 228 if name in TestBuilder.available_suite_names(): |
| 221 suites.append(name) | 229 suites.append(name) |
| 222 else: | 230 else: |
| 223 print ('Error: Invalid suite %s not in ' % name) + \ | 231 print ('Error: Invalid suite %s not in ' % name) + \ |
| 224 '%s' % ','.join(TestBuilder.available_suite_names()) | 232 '%s' % ','.join(TestBuilder.available_suite_names()) |
| 225 sys.exit(1) | 233 sys.exit(1) |
| 226 self.suite_names = suites | 234 self.suite_names = suites |
| 227 self.no_build = args.no_build | 235 self.no_build = args.no_build |
| 228 self.no_upload = args.no_upload | 236 self.no_upload = args.no_upload |
| 229 self.no_test = args.no_test | 237 self.no_test = args.no_test |
| 230 self.verbose = args.verbose | 238 self.verbose = args.verbose |
| 231 return args.continuous, args.incremental | 239 return args.continuous |
| 232 | 240 |
| 233 def run_test_sequence(self, revision_num='', num_reruns=1): | 241 def run_test_sequence(self, revision_num='', num_reruns=1): |
| 234 """Run the set of commands to (possibly) build, run, and post the results | 242 """Run the set of commands to (possibly) build, run, and post the results |
| 235 of our tests. Returns 0 on a successful run, 1 if we fail to post results or | 243 of our tests. Returns 0 on a successful run, 1 if we fail to post results or |
| 236 the run failed, -1 if the build is broken. | 244 the run failed, -1 if the build is broken. |
| 237 """ | 245 """ |
| 238 suites = [] | 246 suites = [] |
| 239 success = True | 247 success = True |
| 240 if not self.no_build and self.sync_and_build(suites, revision_num) == 1: | 248 if not self.no_build and self.sync_and_build(suites, revision_num) == 1: |
| 241 return -1 # The build is broken. | 249 return -1 # The build is broken. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 def __init__(self, test): | 355 def __init__(self, test): |
| 348 self.test = test | 356 self.test = test |
| 349 | 357 |
| 350 def prepare(self): | 358 def prepare(self): |
| 351 """Perform any initial setup required before the test is run.""" | 359 """Perform any initial setup required before the test is run.""" |
| 352 pass | 360 pass |
| 353 | 361 |
| 354 def add_svn_revision_to_trace(self, outfile, browser = None): | 362 def add_svn_revision_to_trace(self, outfile, browser = None): |
| 355 """Add the svn version number to the provided tracefile.""" | 363 """Add the svn version number to the provided tracefile.""" |
| 356 def get_dartium_revision(): | 364 def get_dartium_revision(): |
| 357 version_file_name = os.path.join(TOP_LEVEL_DIR, 'client', 'tests', | 365 version_file_name = os.path.join(DART_REPO_LOC, 'client', 'tests', |
| 358 'dartium', 'LAST_VERSION') | 366 'dartium', 'LAST_VERSION') |
| 359 version_file = open(version_file_name, 'r') | 367 version_file = open(version_file_name, 'r') |
| 360 version = version_file.read().split('.')[-2] | 368 version = version_file.read().split('.')[-2] |
| 361 version_file.close() | 369 version_file.close() |
| 362 return version | 370 return version |
| 363 | 371 |
| 364 if browser and browser == 'dartium': | 372 if browser and browser == 'dartium': |
| 365 revision = get_dartium_revision() | 373 revision = get_dartium_revision() |
| 366 self.test.test_runner.run_cmd(['echo', 'Revision: ' + revision], outfile) | 374 self.test.test_runner.run_cmd(['echo', 'Revision: ' + revision], outfile) |
| 367 else: | 375 else: |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 file_processor) | 470 file_processor) |
| 463 self.platform_list = platform_list | 471 self.platform_list = platform_list |
| 464 self.platform_type = platform_type | 472 self.platform_type = platform_type |
| 465 self.versions = versions | 473 self.versions = versions |
| 466 self.benchmarks = benchmarks | 474 self.benchmarks = benchmarks |
| 467 | 475 |
| 468 | 476 |
| 469 class BrowserTester(Tester): | 477 class BrowserTester(Tester): |
| 470 @staticmethod | 478 @staticmethod |
| 471 def get_browsers(add_dartium=True): | 479 def get_browsers(add_dartium=True): |
| 472 browsers = ['chrome']#['ff', 'chrome'] | 480 browsers = ['ff', 'chrome'] |
| 473 if add_dartium: | 481 if add_dartium: |
| 474 pass | 482 browsers += ['dartium'] |
| 475 #browsers += ['dartium'] | |
| 476 has_shell = False | 483 has_shell = False |
| 477 if platform.system() == 'Darwin': | 484 if platform.system() == 'Darwin': |
| 478 pass | 485 browsers += ['safari'] |
| 479 #browsers += ['safari'] | |
| 480 if platform.system() == 'Windows': | 486 if platform.system() == 'Windows': |
| 481 browsers += ['ie'] | 487 browsers += ['ie'] |
| 482 has_shell = True | 488 has_shell = True |
| 483 if 'dartium' in browsers: | |
| 484 # Fetch it if necessary. | |
| 485 get_dartium = ['python', os.path.join(DART_REPO_LOC, 'tools', | |
| 486 'get_archive.py'), 'dartium'] | |
| 487 # TODO(vsm): It's inconvenient that run_cmd isn't in scope here. | |
| 488 # Perhaps there is a better place to put that or this. | |
| 489 subprocess.call(get_dartium, stdout=sys.stdout, stderr=sys.stderr, | |
| 490 shell=has_shell) | |
| 491 return browsers | 489 return browsers |
| 492 | 490 |
| 493 | 491 |
| 494 class CommonBrowserTest(RuntimePerformanceTest): | 492 class CommonBrowserTest(RuntimePerformanceTest): |
| 495 """Runs this basic performance tests (Benchpress, some V8 benchmarks) in the | 493 """Runs this basic performance tests (Benchpress, some V8 benchmarks) in the |
| 496 browser.""" | 494 browser.""" |
| 497 | 495 |
| 498 def __init__(self, test_runner): | 496 def __init__(self, test_runner): |
| 499 """Args: | 497 """Args: |
| 500 test_runner: Reference to the object that notifies us when to run.""" | 498 test_runner: Reference to the object that notifies us when to run.""" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 def get_dromaeo_benchmarks(): | 658 def get_dromaeo_benchmarks(): |
| 661 valid = DromaeoTester.get_valid_dromaeo_tags() | 659 valid = DromaeoTester.get_valid_dromaeo_tags() |
| 662 benchmarks = reduce(lambda l1,l2: l1+l2, | 660 benchmarks = reduce(lambda l1,l2: l1+l2, |
| 663 [tests for (tag, tests) in | 661 [tests for (tag, tests) in |
| 664 DromaeoTester.DROMAEO_BENCHMARKS.values() | 662 DromaeoTester.DROMAEO_BENCHMARKS.values() |
| 665 if tag in valid]) | 663 if tag in valid]) |
| 666 return map(DromaeoTester.legalize_filename, benchmarks) | 664 return map(DromaeoTester.legalize_filename, benchmarks) |
| 667 | 665 |
| 668 @staticmethod | 666 @staticmethod |
| 669 def get_dromaeo_versions(): | 667 def get_dromaeo_versions(): |
| 670 # TODO(vsm): why is the js version closing early? | 668 return ['js', 'dart2js_dom', 'dart2js_html'] |
| 671 return ['dart2js_dom', 'dart2js_html'] | |
| 672 #return ['js', 'dart2js_dom', 'dart2js_html'] | |
| 673 | 669 |
| 674 | 670 |
| 675 class DromaeoTest(RuntimePerformanceTest): | 671 class DromaeoTest(RuntimePerformanceTest): |
| 676 """Runs Dromaeo tests, in the browser.""" | 672 """Runs Dromaeo tests, in the browser.""" |
| 677 def __init__(self, test_runner): | 673 def __init__(self, test_runner): |
| 678 super(DromaeoTest, self).__init__( | 674 super(DromaeoTest, self).__init__( |
| 679 self.name(), | 675 self.name(), |
| 680 BrowserTester.get_browsers(), | 676 BrowserTester.get_browsers(True), |
| 681 'browser', | 677 'browser', |
| 682 DromaeoTester.get_dromaeo_versions(), | 678 DromaeoTester.get_dromaeo_versions(), |
| 683 DromaeoTester.get_dromaeo_benchmarks(), test_runner, | 679 DromaeoTester.get_dromaeo_benchmarks(), test_runner, |
| 684 self.DromaeoPerfTester(self), | 680 self.DromaeoPerfTester(self), |
| 685 self.DromaeoFileProcessor(self)) | 681 self.DromaeoFileProcessor(self)) |
| 686 | 682 |
| 687 @staticmethod | 683 @staticmethod |
| 688 def name(): | 684 def name(): |
| 689 return 'dromaeo' | 685 return 'dromaeo' |
| 690 | 686 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 703 def move_chrome_driver_if_needed(self, browser): | 699 def move_chrome_driver_if_needed(self, browser): |
| 704 """Move the appropriate version of ChromeDriver onto the path. | 700 """Move the appropriate version of ChromeDriver onto the path. |
| 705 TODO(efortuna): This is a total hack because the latest version of Chrome | 701 TODO(efortuna): This is a total hack because the latest version of Chrome |
| 706 (Dartium builds) requires a different version of ChromeDriver, that is | 702 (Dartium builds) requires a different version of ChromeDriver, that is |
| 707 incompatible with the release or beta Chrome and vice versa. Remove these | 703 incompatible with the release or beta Chrome and vice versa. Remove these |
| 708 shenanigans once we're back to both versions of Chrome using the same | 704 shenanigans once we're back to both versions of Chrome using the same |
| 709 version of ChromeDriver. IMPORTANT NOTE: This assumes your chromedriver is | 705 version of ChromeDriver. IMPORTANT NOTE: This assumes your chromedriver is |
| 710 in the default location (inside depot_tools). | 706 in the default location (inside depot_tools). |
| 711 """ | 707 """ |
| 712 current_dir = os.getcwd() | 708 current_dir = os.getcwd() |
| 709 self.test.test_runner.get_archive('chromedriver') |
| 713 self.test.test_runner.run_cmd(['python', os.path.join( | 710 self.test.test_runner.run_cmd(['python', os.path.join( |
| 714 'tools', 'get_archive.py'), 'chromedriver']) | |
| 715 path = os.environ['PATH'].split(os.pathsep) | 711 path = os.environ['PATH'].split(os.pathsep) |
| 716 orig_chromedriver_path = os.path.join(DART_REPO_LOC, 'tools', 'testing', | 712 orig_chromedriver_path = os.path.join(DART_REPO_LOC, 'tools', 'testing', |
| 717 'orig-chromedriver') | 713 'orig-chromedriver') |
| 718 dartium_chromedriver_path = os.path.join(DART_REPO_LOC, 'tools', | 714 dartium_chromedriver_path = os.path.join(DART_REPO_LOC, 'tools', |
| 719 'testing', | 715 'testing', |
| 720 'dartium-chromedriver') | 716 'dartium-chromedriver') |
| 721 extension = '' | 717 extension = '' |
| 722 if platform.system() == 'Windows': | 718 if platform.system() == 'Windows': |
| 723 extension = '.exe' | 719 extension = '.exe' |
| 724 | 720 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 740 os.makedirs(os.path.dirname(to_dir)) | 736 os.makedirs(os.path.dirname(to_dir)) |
| 741 shutil.copyfile(from_dir, to_dir) | 737 shutil.copyfile(from_dir, to_dir) |
| 742 | 738 |
| 743 for loc in path: | 739 for loc in path: |
| 744 if 'depot_tools' in loc: | 740 if 'depot_tools' in loc: |
| 745 if browser == 'chrome': | 741 if browser == 'chrome': |
| 746 if os.path.exists(orig_chromedriver_path): | 742 if os.path.exists(orig_chromedriver_path): |
| 747 move_chromedriver(loc) | 743 move_chromedriver(loc) |
| 748 elif browser == 'dartium': | 744 elif browser == 'dartium': |
| 749 if not os.path.exists(dartium_chromedriver_path): | 745 if not os.path.exists(dartium_chromedriver_path): |
| 750 self.test.test_runner.run_cmd(['python', | 746 self.test.test_runner.get_archive('chromedriver') |
| 751 os.path.join('tools', 'get_archive.py'), 'chromedriver']) | |
| 752 # Move original chromedriver for storage. | 747 # Move original chromedriver for storage. |
| 753 if not os.path.exists(orig_chromedriver_path): | 748 if not os.path.exists(orig_chromedriver_path): |
| 754 move_chromedriver(loc, copy_to_depot_tools_dir=False) | 749 move_chromedriver(loc, copy_to_depot_tools_dir=False) |
| 755 # Copy Dartium chromedriver into depot_tools | 750 # Copy Dartium chromedriver into depot_tools |
| 756 move_chromedriver(loc, from_path=os.path.join( | 751 move_chromedriver(loc, from_path=os.path.join( |
| 757 dartium_chromedriver_path, 'chromedriver')) | 752 dartium_chromedriver_path, 'chromedriver')) |
| 758 os.chdir(current_dir) | 753 os.chdir(current_dir) |
| 759 | 754 |
| 760 def run_tests(self): | 755 def run_tests(self): |
| 761 """Run dromaeo in the browser.""" | 756 """Run dromaeo in the browser.""" |
| 757 |
| 758 self.test.test_runner.get_archive('dartium') |
| 762 | 759 |
| 763 # Build tests. | 760 # Build tests. |
| 764 dromaeo_path = os.path.join('samples', 'third_party', 'dromaeo') | 761 dromaeo_path = os.path.join('samples', 'third_party', 'dromaeo') |
| 765 current_path = os.getcwd() | 762 current_path = os.getcwd() |
| 766 os.chdir(dromaeo_path) | 763 os.chdir(dromaeo_path) |
| 767 self.test.test_runner.run_cmd(['python', 'generate_dart2js_tests.py']) | 764 self.test.test_runner.run_cmd(['python', 'generate_dart2js_tests.py']) |
| 768 os.chdir(current_path) | 765 os.chdir(current_path) |
| 769 | 766 |
| 770 versions = DromaeoTester.get_dromaeo_versions() | 767 versions = DromaeoTester.get_dromaeo_versions() |
| 771 | 768 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 | 866 |
| 870 | 867 |
| 871 class DromaeoSizeTester(DromaeoTester): | 868 class DromaeoSizeTester(DromaeoTester): |
| 872 def run_tests(self): | 869 def run_tests(self): |
| 873 # Build tests. | 870 # Build tests. |
| 874 dromaeo_path = os.path.join('samples', 'third_party', 'dromaeo') | 871 dromaeo_path = os.path.join('samples', 'third_party', 'dromaeo') |
| 875 current_path = os.getcwd() | 872 current_path = os.getcwd() |
| 876 os.chdir(dromaeo_path) | 873 os.chdir(dromaeo_path) |
| 877 self.test.test_runner.run_cmd( | 874 self.test.test_runner.run_cmd( |
| 878 ['python', os.path.join('generate_dart2js_tests.py')]) | 875 ['python', os.path.join('generate_dart2js_tests.py')]) |
| 876 self.test.test_runner.get_archive('dartium') |
| 879 os.chdir(current_path) | 877 os.chdir(current_path) |
| 880 | 878 |
| 881 self.test.trace_file = os.path.join(TOP_LEVEL_DIR, | 879 self.test.trace_file = os.path.join(TOP_LEVEL_DIR, |
| 882 'tools', 'testing', 'perf_testing', self.test.result_folder_name, | 880 'tools', 'testing', 'perf_testing', self.test.result_folder_name, |
| 883 self.test.result_folder_name + self.test.cur_time) | 881 self.test.result_folder_name + self.test.cur_time) |
| 884 self.add_svn_revision_to_trace(self.test.trace_file) | 882 self.add_svn_revision_to_trace(self.test.trace_file) |
| 885 | 883 |
| 886 variants = [ | 884 variants = [ |
| 887 ('frog_dom', ''), | 885 ('frog_dom', ''), |
| 888 ('frog_html', '-html'), | 886 ('frog_html', '-html'), |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1109 for line in output.split('\n'): | 1107 for line in output.split('\n'): |
| 1110 if 'Revision' in line: | 1108 if 'Revision' in line: |
| 1111 return line.split()[1] | 1109 return line.split()[1] |
| 1112 return -1 | 1110 return -1 |
| 1113 | 1111 |
| 1114 def update_set_of_done_cls(revision_num=None): | 1112 def update_set_of_done_cls(revision_num=None): |
| 1115 """Update the set of CLs that do not need additional performance runs. | 1113 """Update the set of CLs that do not need additional performance runs. |
| 1116 Args: | 1114 Args: |
| 1117 revision_num: an additional number to be added to the 'done set' | 1115 revision_num: an additional number to be added to the 'done set' |
| 1118 """ | 1116 """ |
| 1119 filename = os.path.join(dirname(abspath(__file__)), 'cached_results.txt') | 1117 filename = os.path.join(TOP_LEVEL_DIR, 'cached_results.txt') |
| 1120 if not os.path.exists(filename): | 1118 if not os.path.exists(filename): |
| 1121 f = open(filename, 'w') | 1119 f = open(filename, 'w') |
| 1122 results = set() | 1120 results = set() |
| 1123 pickle.dump(results, f) | 1121 pickle.dump(results, f) |
| 1124 f.close() | 1122 f.close() |
| 1125 f = open(filename, 'r+') | 1123 f = open(filename, 'r+') |
| 1126 result_set = pickle.load(f) | 1124 result_set = pickle.load(f) |
| 1127 if revision_num: | 1125 if revision_num: |
| 1128 f.seek(0) | 1126 f.seek(0) |
| 1129 result_set.add(revision_num) | 1127 result_set.add(revision_num) |
| 1130 pickle.dump(result_set, f) | 1128 pickle.dump(result_set, f) |
| 1131 f.close() | 1129 f.close() |
| 1132 return result_set | 1130 return result_set |
| 1133 | 1131 |
| 1134 def main(): | 1132 def main(): |
| 1135 runner = TestRunner() | 1133 runner = TestRunner() |
| 1136 continuous, incremental = runner.parse_args() | 1134 continuous = runner.parse_args() |
| 1137 | 1135 |
| 1138 if not os.path.exists(DART_REPO_LOC): | 1136 if not os.path.exists(DART_REPO_LOC): |
| 1139 os.mkdir(dirname(DART_REPO_LOC)) | 1137 os.mkdir(dirname(DART_REPO_LOC)) |
| 1140 os.chdir(dirname(DART_REPO_LOC)) | 1138 os.chdir(dirname(DART_REPO_LOC)) |
| 1141 p = subprocess.Popen('gclient config https://dart.googlecode.com/svn/' + | 1139 p = subprocess.Popen('gclient config https://dart.googlecode.com/svn/' + |
| 1142 'branches/bleeding_edge/deps/all.deps', | 1140 'branches/bleeding_edge/deps/all.deps', |
| 1143 stdout=subprocess.PIPE, stderr=subprocess.PIPE, | 1141 stdout=subprocess.PIPE, stderr=subprocess.PIPE, |
| 1144 shell=True) | 1142 shell=True) |
| 1145 p.communicate() | 1143 p.communicate() |
| 1146 if continuous: | 1144 if continuous: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 1171 a_test.file_processor.get_score_type(benchmark_name)) | 1169 a_test.file_processor.get_score_type(benchmark_name)) |
| 1172 if number_of_results < 10 and number_of_results >= 0: | 1170 if number_of_results < 10 and number_of_results >= 0: |
| 1173 run = runner.run_test_sequence(revision_num=str(revision_num), | 1171 run = runner.run_test_sequence(revision_num=str(revision_num), |
| 1174 num_reruns=(10-number_of_results)) | 1172 num_reruns=(10-number_of_results)) |
| 1175 if run == 0: | 1173 if run == 0: |
| 1176 has_run_extra = True | 1174 has_run_extra = True |
| 1177 results_set = update_set_of_done_cls(revision_num) | 1175 results_set = update_set_of_done_cls(revision_num) |
| 1178 revision_num -= 1 | 1176 revision_num -= 1 |
| 1179 # No more extra back-runs to do (for now). Wait for new code. | 1177 # No more extra back-runs to do (for now). Wait for new code. |
| 1180 time.sleep(200) | 1178 time.sleep(200) |
| 1181 elif incremental: | |
| 1182 # This is a temporary measure to backfill old revisions. | |
| 1183 # TODO(efortuna): Clean this up -- don't hard code numbers, make user | |
| 1184 # specifiable. | |
| 1185 revision_num = 9000 | |
| 1186 while revision_num < 10600: | |
| 1187 run = runner.run_test_sequence(revision_num=str(revision_num), | |
| 1188 num_reruns=10) | |
| 1189 revision_num += 1 | |
| 1190 else: | 1179 else: |
| 1191 runner.run_test_sequence() | 1180 runner.run_test_sequence() |
| 1192 | 1181 |
| 1193 if __name__ == '__main__': | 1182 if __name__ == '__main__': |
| 1194 main() | 1183 main() |
| OLD | NEW |