| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 system == 'linux' and platform.system() != 'Linux'): | 79 system == 'linux' and platform.system() != 'Linux'): |
| 80 print ('Error: You cannot emulate a buildbot with a platform different ' | 80 print ('Error: You cannot emulate a buildbot with a platform different ' |
| 81 'from your own.') | 81 'from your own.') |
| 82 return None | 82 return None |
| 83 | 83 |
| 84 return bot.BuildInfo(compiler, runtime, mode, system, checked, host_checked, | 84 return bot.BuildInfo(compiler, runtime, mode, system, checked, host_checked, |
| 85 shard_index, total_shards, is_buildbot, test_set) | 85 shard_index, total_shards, is_buildbot, test_set) |
| 86 | 86 |
| 87 | 87 |
| 88 def NeedsXterm(compiler, runtime): | 88 def NeedsXterm(compiler, runtime): |
| 89 return runtime in ['ie', 'chrome', 'safari', 'opera', 'ff', 'drt'] | 89 return runtime in ['ie9', 'ie10', 'chrome', 'safari', 'opera', 'ff', 'drt'] |
| 90 | 90 |
| 91 | 91 |
| 92 def TestStepName(name, flags): | 92 def TestStepName(name, flags): |
| 93 # Filter out flags with '=' as this breaks the /stats feature of the | 93 # Filter out flags with '=' as this breaks the /stats feature of the |
| 94 # build bot. | 94 # build bot. |
| 95 flags = [x for x in flags if not '=' in x] | 95 flags = [x for x in flags if not '=' in x] |
| 96 return ('%s tests %s' % (name, ' '.join(flags))).strip() | 96 return ('%s tests %s' % (name, ' '.join(flags))).strip() |
| 97 | 97 |
| 98 | 98 |
| 99 def TestStep(name, mode, system, compiler, runtime, targets, flags): | 99 def TestStep(name, mode, system, compiler, runtime, targets, flags): |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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', or 'win7' |
| 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 == '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. |
| 149 flags += ['-j1'] | 149 flags += ['-j1'] |
| 150 | 150 |
| 151 def GetPath(runtime): | 151 def GetPath(runtime): |
| 152 """ Helper to get the path to the Chrome or Firefox executable for a | 152 """ Helper to get the path to the Chrome or Firefox executable for a |
| 153 particular platform on the buildbot. Throws a KeyError if runtime is not | 153 particular platform on the buildbot. Throws a KeyError if runtime is not |
| 154 either 'chrome' or 'ff'.""" | 154 either 'chrome' or 'ff'.""" |
| 155 if system == 'mac': | 155 if system == 'mac': |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 except IndexError: | 188 except IndexError: |
| 189 # Failed to obtain version information. Continue running tests. | 189 # Failed to obtain version information. Continue running tests. |
| 190 pass | 190 pass |
| 191 | 191 |
| 192 if runtime == 'd8': | 192 if runtime == 'd8': |
| 193 # The dart2js compiler isn't self-hosted (yet) so we run its | 193 # The dart2js compiler isn't self-hosted (yet) so we run its |
| 194 # unit tests on the VM. We avoid doing this on the builders | 194 # unit tests on the VM. We avoid doing this on the builders |
| 195 # that run the browser tests to cut down on the cycle time. | 195 # that run the browser tests to cut down on the cycle time. |
| 196 TestStep("dart2js_unit", mode, system, 'none', 'vm', ['dart2js'], flags) | 196 TestStep("dart2js_unit", mode, system, 'none', 'vm', ['dart2js'], flags) |
| 197 | 197 |
| 198 if not (system.startswith('win') and runtime == 'ie'): | 198 if not (system.startswith('win') and runtime.startswith('ie')): |
| 199 # Run the default set of test suites. | 199 # Run the default set of test suites. |
| 200 TestStep("dart2js", mode, system, 'dart2js', runtime, [], flags) | 200 TestStep("dart2js", mode, system, 'dart2js', runtime, [], flags) |
| 201 | 201 |
| 202 # TODO(kasperl): Consider running peg and css tests too. | 202 # TODO(kasperl): Consider running peg and css tests too. |
| 203 extras = ['dart2js_extra', 'dart2js_native', 'dart2js_foreign'] | 203 extras = ['dart2js_extra', 'dart2js_native', 'dart2js_foreign'] |
| 204 TestStep("dart2js_extra", mode, system, 'dart2js', runtime, extras, flags) | 204 TestStep("dart2js_extra", mode, system, 'dart2js', runtime, extras, flags) |
| 205 else: | 205 else: |
| 206 # TODO(ricow): Enable standard sharding for IE bots when we have more vms. | 206 # TODO(ricow): Enable standard sharding for IE bots when we have more vms. |
| 207 if test_set == 'html': | 207 if test_set == 'html': |
| 208 TestStep("dart2js", mode, system, 'dart2js', runtime, ['html'], flags) | 208 TestStep("dart2js", mode, system, 'dart2js', runtime, ['html'], flags) |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 == 'ie' and | 263 if (build_info.system == 'win7' and build_info.runtime.startswith('ie') and |
| 264 build_info.test_set == 'all'): | 264 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] |
| (...skipping 10 matching lines...) Expand all Loading... |
| 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 |