Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """ | 7 """ |
| 8 Dart2js buildbot steps | 8 Dart2js buildbot steps |
| 9 | 9 |
| 10 Runs tests for the dart2js compiler. | 10 Runs tests for the dart2js compiler. |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 | 128 |
| 129 print 'running %s' % (' '.join(cmd)) | 129 print 'running %s' % (' '.join(cmd)) |
| 130 bot.RunProcess(cmd) | 130 bot.RunProcess(cmd) |
| 131 | 131 |
| 132 | 132 |
| 133 def TestCompiler(runtime, mode, system, flags, is_buildbot, test_set): | 133 def TestCompiler(runtime, mode, system, flags, is_buildbot, test_set): |
| 134 """ test the compiler. | 134 """ test the compiler. |
| 135 Args: | 135 Args: |
| 136 - runtime: either 'd8', 'jsshell', or one of the browsers, see GetBuildInfo | 136 - runtime: either 'd8', 'jsshell', or one of the browsers, see GetBuildInfo |
| 137 - mode: either 'debug' or 'release' | 137 - mode: either 'debug' or 'release' |
| 138 - system: either 'linux', 'mac', or 'win7' | 138 - system: either 'linux', 'mac', 'win7', or 'win8' |
| 139 - flags: extra flags to pass to test.dart | 139 - flags: extra flags to pass to test.dart |
| 140 - is_buildbot: true if we are running on a real buildbot instead of | 140 - is_buildbot: true if we are running on a real buildbot instead of |
| 141 emulating one. | 141 emulating one. |
| 142 - test_set: Specification of a non standard test set, default None | 142 - test_set: Specification of a non standard test set, default None |
| 143 """ | 143 """ |
| 144 | 144 |
| 145 if system.startswith('win') and runtime.startswith('ie'): | 145 if system.startswith('win') and runtime.startswith('ie'): |
| 146 # There should not be more than one InternetExplorerDriver instance | 146 # There should not be more than one InternetExplorerDriver instance |
| 147 # running at a time. For details, see | 147 # running at a time. For details, see |
| 148 # http://code.google.com/p/selenium/wiki/InternetExplorerDriver. | 148 # http://code.google.com/p/selenium/wiki/InternetExplorerDriver. |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 167 'Local', 'Google', 'Chrome', 'Application', 'chrome.exe')} | 167 'Local', 'Google', 'Chrome', 'Application', 'chrome.exe')} |
| 168 return path_dict[runtime] | 168 return path_dict[runtime] |
| 169 | 169 |
| 170 if system == 'linux' and runtime == 'chrome': | 170 if system == 'linux' and runtime == 'chrome': |
| 171 # TODO(ngeoffray): We should install selenium on the buildbot. | 171 # TODO(ngeoffray): We should install selenium on the buildbot. |
| 172 runtime = 'drt' | 172 runtime = 'drt' |
| 173 elif (runtime == 'ff' or runtime == 'chrome') and is_buildbot: | 173 elif (runtime == 'ff' or runtime == 'chrome') and is_buildbot: |
| 174 # Print out browser version numbers if we're running on the buildbot (where | 174 # Print out browser version numbers if we're running on the buildbot (where |
| 175 # we know the paths to these browser installations). | 175 # we know the paths to these browser installations). |
| 176 version_query_string = '"%s" --version' % GetPath(runtime) | 176 version_query_string = '"%s" --version' % GetPath(runtime) |
| 177 if runtime == 'ff' and system == 'win7': | 177 if runtime == 'ff' and system.startswith('win'): |
| 178 version_query_string += '| more' | 178 version_query_string += '| more' |
| 179 elif runtime == 'chrome' and system == 'win7': | 179 elif runtime == 'chrome' and system.startswith('win'): |
| 180 version_query_string = ('''reg query "HKCU\\Software\\Microsoft\\''' + | 180 version_query_string = ('''reg query "HKCU\\Software\\Microsoft\\''' + |
| 181 '''Windows\\CurrentVersion\\Uninstall\\Google Chrome" /v Version''') | 181 '''Windows\\CurrentVersion\\Uninstall\\Google Chrome" /v Version''') |
| 182 p = subprocess.Popen(version_query_string, | 182 p = subprocess.Popen(version_query_string, |
| 183 stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) | 183 stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) |
| 184 output, stderr = p.communicate() | 184 output, stderr = p.communicate() |
| 185 output = output.split() | 185 output = output.split() |
| 186 try: | 186 try: |
| 187 print 'Version of %s: %s' % (runtime, output[-1]) | 187 print 'Version of %s: %s' % (runtime, output[-1]) |
| 188 except IndexError: | 188 except IndexError: |
| 189 # Failed to obtain version information. Continue running tests. | 189 # Failed to obtain version information. Continue running tests. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 clear out the temp files, so we do so explicitly here. Our batch browser | 232 clear out the temp files, so we do so explicitly here. Our batch browser |
| 233 testing will make this problem occur much less frequently, but will still | 233 testing will make this problem occur much less frequently, but will still |
| 234 happen eventually unless we do this. | 234 happen eventually unless we do this. |
| 235 | 235 |
| 236 This problem also occurs with batch tests in Firefox. For some reason selenium | 236 This problem also occurs with batch tests in Firefox. For some reason selenium |
| 237 automatically deletes the temporary profiles for Firefox for one browser, | 237 automatically deletes the temporary profiles for Firefox for one browser, |
| 238 but not multiple ones when we have many open batch tasks running. This | 238 but not multiple ones when we have many open batch tasks running. This |
| 239 behavior has not been reproduced outside of the buildbots. | 239 behavior has not been reproduced outside of the buildbots. |
| 240 | 240 |
| 241 Args: | 241 Args: |
| 242 - system: either 'linux', 'mac', or 'win7' | 242 - system: either 'linux', 'mac', 'win7', or 'win8' |
| 243 - browser: one of the browsers, see GetBuildInfo | 243 - browser: one of the browsers, see GetBuildInfo |
| 244 """ | 244 """ |
| 245 if system == 'win7': | 245 if system.startswith('win'): |
| 246 shutil.rmtree('C:\\Users\\chrome-bot\\AppData\\Local\\Temp', | 246 shutil.rmtree('C:\\Users\\chrome-bot\\AppData\\Local\\Temp', |
| 247 ignore_errors=True) | 247 ignore_errors=True) |
| 248 elif browser == 'ff' or 'opera': | 248 elif browser == 'ff' or 'opera': |
| 249 # Note: the buildbots run as root, so we can do this without requiring a | 249 # Note: the buildbots run as root, so we can do this without requiring a |
| 250 # password. The command won't actually work on regular machines without | 250 # password. The command won't actually work on regular machines without |
| 251 # root permissions. | 251 # root permissions. |
| 252 _DeleteTempWebdriverProfiles('/tmp') | 252 _DeleteTempWebdriverProfiles('/tmp') |
| 253 _DeleteTempWebdriverProfiles('/var/tmp') | 253 _DeleteTempWebdriverProfiles('/var/tmp') |
| 254 | 254 |
| 255 | 255 |
| 256 def GetHasHardCodedCheckedMode(build_info): | 256 def GetHasHardCodedCheckedMode(build_info): |
| 257 # TODO(ricow): We currently run checked mode tests on chrome on linux and | 257 # TODO(ricow): We currently run checked mode tests on chrome on linux and |
| 258 # on the slow (all) IE windows bots. This is a hack and we should use the | 258 # on the slow (all) IE windows bots. This is a hack and we should use the |
| 259 # normal sharding and checked splitting functionality when we get more | 259 # normal sharding and checked splitting functionality when we get more |
| 260 # vms for testing this. | 260 # vms for testing this. |
| 261 if (build_info.system == 'linux' and build_info.runtime == 'chrome'): | 261 if (build_info.system == 'linux' and build_info.runtime == 'chrome'): |
| 262 return True | 262 return True |
| 263 if (build_info.system == 'win7' and build_info.runtime.startswith('ie') and | 263 if (build_info.system.startswith('win') and |
|
Bob Nystrom
2012/10/25 00:32:54
Is this clause needed? Doesn't checking for "ie" k
Emily Fortuna
2012/10/25 00:44:24
Fair enough. Removed.
| |
| 264 build_info.test_set == 'all'): | 264 build_info.runtime.startswith('ie') and build_info.test_set == 'all'): |
| 265 return True | 265 return True |
| 266 return False | 266 return False |
| 267 | 267 |
| 268 | 268 |
| 269 def RunCompilerTests(build_info): | 269 def RunCompilerTests(build_info): |
| 270 test_flags = [] | 270 test_flags = [] |
| 271 if build_info.shard_index: | 271 if build_info.shard_index: |
| 272 test_flags = ['--shards=%s' % build_info.total_shards, | 272 test_flags = ['--shards=%s' % build_info.total_shards, |
| 273 '--shard=%s' % build_info.shard_index] | 273 '--shard=%s' % build_info.shard_index] |
| 274 | 274 |
| 275 if build_info.checked: test_flags += ['--checked'] | 275 if build_info.checked: test_flags += ['--checked'] |
| 276 | 276 |
| 277 if build_info.host_checked: test_flags += ['--host-checked'] | 277 if build_info.host_checked: test_flags += ['--host-checked'] |
| 278 | 278 |
| 279 TestCompiler(build_info.runtime, build_info.mode, build_info.system, | 279 TestCompiler(build_info.runtime, build_info.mode, build_info.system, |
| 280 list(test_flags), build_info.is_buildbot, build_info.test_set) | 280 list(test_flags), build_info.is_buildbot, build_info.test_set) |
| 281 | 281 |
| 282 # See comment in GetHasHardCodedCheckedMode, this is a hack. | 282 # See comment in GetHasHardCodedCheckedMode, this is a hack. |
| 283 if (GetHasHardCodedCheckedMode(build_info)): | 283 if (GetHasHardCodedCheckedMode(build_info)): |
| 284 TestCompiler(build_info.runtime, build_info.mode, build_info.system, | 284 TestCompiler(build_info.runtime, build_info.mode, build_info.system, |
| 285 test_flags + ['--checked'], build_info.is_buildbot, | 285 test_flags + ['--checked'], build_info.is_buildbot, |
| 286 build_info.test_set) | 286 build_info.test_set) |
| 287 | 287 |
| 288 if build_info.runtime != 'd8': | 288 if build_info.runtime != 'd8': |
| 289 CleanUpTemporaryFiles(build_info.system, build_info.runtime) | 289 CleanUpTemporaryFiles(build_info.system, build_info.runtime) |
| 290 | 290 |
| 291 | 291 |
| 292 if __name__ == '__main__': | 292 if __name__ == '__main__': |
| 293 bot.RunBot(GetBuildInfo, RunCompilerTests) | 293 bot.RunBot(GetBuildInfo, RunCompilerTests) |
| OLD | NEW |