| 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 """ | 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. |
| 11 """ | 11 """ |
| 12 | 12 |
| 13 import os | 13 import os |
| 14 import platform | 14 import platform |
| 15 import re | 15 import re |
| 16 import shutil | 16 import shutil |
| 17 import socket | 17 import socket |
| 18 import string |
| 18 import subprocess | 19 import subprocess |
| 19 import sys | 20 import sys |
| 20 | 21 |
| 21 import bot | 22 import bot |
| 22 | 23 |
| 23 DARTIUM_BUILDER = r'none-dartium-(linux|mac|windows)' | 24 DARTIUM_BUILDER = r'none-dartium-(linux|mac|windows)' |
| 24 DART2JS_BUILDER = ( | 25 DART2JS_BUILDER = ( |
| 25 r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-ch
ecked))?(-(host-checked))?(-(minified))?(-(x64))?(-(batch))?-?(\d*)-?(\d*)') | 26 r'dart2js-(linux|mac|windows)(-(jsshell))?-(debug|release)(-(checked|host-ch
ecked))?(-(host-checked))?(-(minified))?(-(x64))?(-(batch))?-?(\d*)-?(\d*)') |
| 26 DART2JS_FULL_BUILDER = r'dart2js-full-(linux|mac|windows)(-checked)?(-minified)?
-(\d+)-(\d+)' | 27 DART2JS_FULL_BUILDER = r'dart2js-full-(linux|mac|windows-ie10|windows-ie11)(-che
cked)?(-minified)?-(\d+)-(\d+)' |
| 27 WEB_BUILDER = ( | 28 WEB_BUILDER = ( |
| 28 r'dart2js-(ie9|ie10|ie11|ff|safari|chrome|chromeOnAndroid|safarimobilesim|op
era|drt)-(win7|win8|mac10\.8|mac10\.7|linux)(-(all|html))?(-(csp))?(-(\d+)-(\d+)
)?') | 29 r'dart2js-(ie9|ie10|ie11|ff|safari|chrome|chromeOnAndroid|safarimobilesim|op
era|drt)-(win7|win8|mac10\.8|mac10\.7|linux)(-(all|html))?(-(csp))?(-(\d+)-(\d+)
)?') |
| 29 | 30 |
| 31 IE_VERSIONS = ['ie10', 'ie11'] |
| 32 |
| 30 DART2JS_FULL_CONFIGURATIONS = { | 33 DART2JS_FULL_CONFIGURATIONS = { |
| 31 'linux' : [ ], | 34 'linux' : [ ], |
| 32 'mac' : [ ], | 35 'mac' : [ ], |
| 33 'windows' : [ | 36 'windows-ie10' : [ |
| 34 {'runtime' : 'ie9'}, | 37 {'runtime' : 'ie10'}, |
| 35 {'runtime' : 'ie9', 'additional_flags' : ['--checked']}, | 38 {'runtime' : 'ie10', 'additional_flags' : ['--checked']}, |
| 39 {'runtime' : 'chrome'}, |
| 40 ], |
| 41 'windows-ie11' : [ |
| 42 {'runtime' : 'ie11'}, |
| 43 {'runtime' : 'ie11', 'additional_flags' : ['--checked']}, |
| 36 {'runtime' : 'ff'}, | 44 {'runtime' : 'ff'}, |
| 37 {'runtime' : 'chrome'}, | |
| 38 ], | 45 ], |
| 39 } | 46 } |
| 40 | 47 |
| 41 | 48 |
| 42 def GetBuildInfo(builder_name, is_buildbot): | 49 def GetBuildInfo(builder_name, is_buildbot): |
| 43 """Returns a BuildInfo object for the current buildbot based on the | 50 """Returns a BuildInfo object for the current buildbot based on the |
| 44 name of the builder. | 51 name of the builder. |
| 45 """ | 52 """ |
| 46 compiler = None | 53 compiler = None |
| 47 runtime = None | 54 runtime = None |
| 48 mode = None | 55 mode = None |
| 49 system = None | 56 system = None |
| 50 checked = False | 57 checked = False |
| 51 host_checked = False | 58 host_checked = False |
| 52 minified = False | 59 minified = False |
| 53 shard_index = None | 60 shard_index = None |
| 54 total_shards = None | 61 total_shards = None |
| 55 test_set = None | 62 test_set = None |
| 56 csp = None | 63 csp = None |
| 57 arch = None | 64 arch = None |
| 58 dart2js_full = False | 65 dart2js_full = False |
| 59 batch = False | 66 batch = False |
| 67 builder_tag = None |
| 60 | 68 |
| 61 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name) | 69 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name) |
| 62 dart2js_full_pattern = re.match(DART2JS_FULL_BUILDER, builder_name) | 70 dart2js_full_pattern = re.match(DART2JS_FULL_BUILDER, builder_name) |
| 63 web_pattern = re.match(WEB_BUILDER, builder_name) | 71 web_pattern = re.match(WEB_BUILDER, builder_name) |
| 64 dartium_pattern = re.match(DARTIUM_BUILDER, builder_name) | 72 dartium_pattern = re.match(DARTIUM_BUILDER, builder_name) |
| 65 | 73 |
| 66 if web_pattern: | 74 if web_pattern: |
| 67 compiler = 'dart2js' | 75 compiler = 'dart2js' |
| 68 runtime = web_pattern.group(1) | 76 runtime = web_pattern.group(1) |
| 69 system = web_pattern.group(2) | 77 system = web_pattern.group(2) |
| 70 mode = 'release' | 78 mode = 'release' |
| 71 test_set = web_pattern.group(4) | 79 test_set = web_pattern.group(4) |
| 72 if web_pattern.group(6) == 'csp': | 80 if web_pattern.group(6) == 'csp': |
| 73 csp = True | 81 csp = True |
| 74 shard_index = web_pattern.group(8) | 82 shard_index = web_pattern.group(8) |
| 75 total_shards = web_pattern.group(9) | 83 total_shards = web_pattern.group(9) |
| 76 elif dart2js_full_pattern: | 84 elif dart2js_full_pattern: |
| 77 mode = 'release' | 85 mode = 'release' |
| 78 compiler = 'dart2js' | 86 compiler = 'dart2js' |
| 79 dart2js_full = True | 87 dart2js_full = True |
| 80 system = dart2js_full_pattern.group(1) | 88 system = dart2js_full_pattern.group(1) |
| 89 # windows-ie10 or windows-ie11 means a windows machine with that respective |
| 90 # version of ie installed. There is no difference in how we handle testing. |
| 91 # We use the builder tag to pass along this information. |
| 92 if system.startswith('windows'): |
| 93 system_and_ie = string.split(system, '-') |
| 94 assert len(system_and_ie) == 2 |
| 95 assert system_and_ie[0] == 'windows' |
| 96 assert system_and_ie[1] in IE_VERSIONS |
| 97 builder_tag = system |
| 98 system = 'windows' |
| 81 if dart2js_full_pattern.group(2): | 99 if dart2js_full_pattern.group(2): |
| 82 checked = True | 100 checked = True |
| 83 if dart2js_full_pattern.group(3): | 101 if dart2js_full_pattern.group(3): |
| 84 minified = True | 102 minified = True |
| 85 shard_index = dart2js_full_pattern.group(4) | 103 shard_index = dart2js_full_pattern.group(4) |
| 86 total_shards = dart2js_full_pattern.group(5) | 104 total_shards = dart2js_full_pattern.group(5) |
| 87 elif dart2js_pattern: | 105 elif dart2js_pattern: |
| 88 compiler = 'dart2js' | 106 compiler = 'dart2js' |
| 89 system = dart2js_pattern.group(1) | 107 system = dart2js_pattern.group(1) |
| 90 runtime = 'd8' | 108 runtime = 'd8' |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 system = 'mac' | 146 system = 'mac' |
| 129 | 147 |
| 130 if (system == 'windows' and platform.system() != 'Windows') or ( | 148 if (system == 'windows' and platform.system() != 'Windows') or ( |
| 131 system == 'mac' and platform.system() != 'Darwin') or ( | 149 system == 'mac' and platform.system() != 'Darwin') or ( |
| 132 system == 'linux' and platform.system() != 'Linux'): | 150 system == 'linux' and platform.system() != 'Linux'): |
| 133 print ('Error: You cannot emulate a buildbot with a platform different ' | 151 print ('Error: You cannot emulate a buildbot with a platform different ' |
| 134 'from your own.') | 152 'from your own.') |
| 135 return None | 153 return None |
| 136 return bot.BuildInfo(compiler, runtime, mode, system, checked, host_checked, | 154 return bot.BuildInfo(compiler, runtime, mode, system, checked, host_checked, |
| 137 minified, shard_index, total_shards, is_buildbot, | 155 minified, shard_index, total_shards, is_buildbot, |
| 138 test_set, csp, arch, dart2js_full, batch=batch) | 156 test_set, csp, arch, dart2js_full, batch=batch, |
| 157 builder_tag=builder_tag) |
| 139 | 158 |
| 140 | 159 |
| 141 def NeedsXterm(compiler, runtime): | 160 def NeedsXterm(compiler, runtime): |
| 142 return runtime in ['ie9', 'ie10', 'ie11', 'chrome', 'safari', 'opera', | 161 return runtime in ['ie9', 'ie10', 'ie11', 'chrome', 'safari', 'opera', |
| 143 'ff', 'drt', 'dartium'] | 162 'ff', 'drt', 'dartium'] |
| 144 | 163 |
| 145 | 164 |
| 146 def TestStepName(name, runtime, flags): | 165 def TestStepName(name, runtime, flags): |
| 147 # Filter out flags with '=' as this breaks the /stats feature of the | 166 # Filter out flags with '=' as this breaks the /stats feature of the |
| 148 # build bot. | 167 # build bot. |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 if build_info.host_checked: test_flags += ['--host-checked'] | 353 if build_info.host_checked: test_flags += ['--host-checked'] |
| 335 if build_info.batch: test_flags += ['--dart2js-batch'] | 354 if build_info.batch: test_flags += ['--dart2js-batch'] |
| 336 | 355 |
| 337 if build_info.dart2js_full: | 356 if build_info.dart2js_full: |
| 338 compiler = build_info.compiler | 357 compiler = build_info.compiler |
| 339 assert compiler == 'dart2js' | 358 assert compiler == 'dart2js' |
| 340 system = build_info.system | 359 system = build_info.system |
| 341 arch = build_info.arch | 360 arch = build_info.arch |
| 342 mode = build_info.mode | 361 mode = build_info.mode |
| 343 is_buildbot = build_info.is_buildbot | 362 is_buildbot = build_info.is_buildbot |
| 344 for configuration in DART2JS_FULL_CONFIGURATIONS[system]: | 363 |
| 364 config = build_info.builder_tag if system == 'windows' else system |
| 365 for configuration in DART2JS_FULL_CONFIGURATIONS[config]: |
| 345 additional_flags = configuration.get('additional_flags', []) | 366 additional_flags = configuration.get('additional_flags', []) |
| 346 TestCompiler(configuration['runtime'], mode, system, | 367 TestCompiler(configuration['runtime'], mode, system, |
| 347 test_flags + additional_flags, is_buildbot, arch, | 368 test_flags + additional_flags, is_buildbot, arch, |
| 348 compiler=compiler, dart2js_full=True) | 369 compiler=compiler, dart2js_full=True) |
| 349 else: | 370 else: |
| 350 if build_info.csp: test_flags += ['--csp'] | 371 if build_info.csp: test_flags += ['--csp'] |
| 351 | 372 |
| 352 if build_info.runtime == 'chromeOnAndroid': | 373 if build_info.runtime == 'chromeOnAndroid': |
| 353 test_flags.append('--local_ip=%s' % GetLocalIPAddress()) | 374 test_flags.append('--local_ip=%s' % GetLocalIPAddress()) |
| 354 # test.py expects the android tools directories to be in PATH | 375 # test.py expects the android tools directories to be in PATH |
| (...skipping 25 matching lines...) Expand all Loading... |
| 380 if build_info.mode == 'debug': | 401 if build_info.mode == 'debug': |
| 381 target = 'dart2js_bot_debug' | 402 target = 'dart2js_bot_debug' |
| 382 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode, | 403 args = [sys.executable, './tools/build.py', '--mode=' + build_info.mode, |
| 383 '--arch=' + build_info.arch, target] | 404 '--arch=' + build_info.arch, target] |
| 384 print 'Build SDK and d8: %s' % (' '.join(args)) | 405 print 'Build SDK and d8: %s' % (' '.join(args)) |
| 385 bot.RunProcess(args) | 406 bot.RunProcess(args) |
| 386 | 407 |
| 387 | 408 |
| 388 if __name__ == '__main__': | 409 if __name__ == '__main__': |
| 389 bot.RunBot(GetBuildInfo, RunCompilerTests, build_step=BuildCompiler) | 410 bot.RunBot(GetBuildInfo, RunCompilerTests, build_step=BuildCompiler) |
| OLD | NEW |