| 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 """Dart frog buildbot steps | 7 """Dart frog buildbot steps |
| 8 | 8 |
| 9 Runs tests for the frog compiler (running on the vm or the self-hosting version) | 9 Runs tests for the frog compiler (running on the vm or the self-hosting version) |
| 10 """ | 10 """ |
| 11 | 11 |
| 12 import os | 12 import os |
| 13 import re | 13 import re |
| 14 import shutil | 14 import shutil |
| 15 import subprocess | 15 import subprocess |
| 16 import sys | 16 import sys |
| 17 | 17 |
| 18 BUILDER_NAME = 'BUILDBOT_BUILDERNAME' | 18 BUILDER_NAME = 'BUILDBOT_BUILDERNAME' |
| 19 | 19 |
| 20 DART_PATH = os.path.dirname( | 20 DART_PATH = os.path.dirname( |
| 21 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 21 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
| 22 | 22 |
| 23 DART2JS_BUILDER = r'dart2js-(linux|mac|windows)-(debug|release)(-[a-z]+)?' | 23 DART2JS_BUILDER = r'dart2js-(linux|mac|windows)-(debug|release)(-([a-z]+))?' |
| 24 FROG_BUILDER = r'(frog|frogsh)-(linux|mac|windows)-(debug|release)' | 24 FROG_BUILDER = r'(frog|frogsh)-(linux|mac|windows)-(debug|release)' |
| 25 WEB_BUILDER = r'web-(ie|ff|safari|chrome|opera)-(win7|win8|mac|linux)(-(\d+))?' | 25 WEB_BUILDER = r'web-(ie|ff|safari|chrome|opera)-(win7|win8|mac|linux)(-(\d+))?' |
| 26 | 26 |
| 27 NO_COLOR_ENV = dict(os.environ) | 27 NO_COLOR_ENV = dict(os.environ) |
| 28 NO_COLOR_ENV['TERM'] = 'nocolor' | 28 NO_COLOR_ENV['TERM'] = 'nocolor' |
| 29 | 29 |
| 30 def GetBuildInfo(): | 30 def GetBuildInfo(): |
| 31 """Returns a tuple (name, mode, system, browser, option) where: | 31 """Returns a tuple (name, mode, system, browser, option) where: |
| 32 - name: 'dart2js', 'frog', 'frogsh', 'frogium', or None when the | 32 - name: 'dart2js', 'frog', 'frogsh', 'frogium', or None when the |
| 33 builder has an incorrect name | 33 builder has an incorrect name |
| (...skipping 11 matching lines...) Expand all Loading... |
| 45 if builder_name: | 45 if builder_name: |
| 46 | 46 |
| 47 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name) | 47 dart2js_pattern = re.match(DART2JS_BUILDER, builder_name) |
| 48 frog_pattern = re.match(FROG_BUILDER, builder_name) | 48 frog_pattern = re.match(FROG_BUILDER, builder_name) |
| 49 web_pattern = re.match(WEB_BUILDER, builder_name) | 49 web_pattern = re.match(WEB_BUILDER, builder_name) |
| 50 | 50 |
| 51 if dart2js_pattern: | 51 if dart2js_pattern: |
| 52 name = 'dart2js' | 52 name = 'dart2js' |
| 53 system = dart2js_pattern.group(1) | 53 system = dart2js_pattern.group(1) |
| 54 mode = dart2js_pattern.group(2) | 54 mode = dart2js_pattern.group(2) |
| 55 option = dart2js_pattern.group(3) | 55 option = dart2js_pattern.group(4) |
| 56 | 56 |
| 57 elif frog_pattern: | 57 elif frog_pattern: |
| 58 name = frog_pattern.group(1) | 58 name = frog_pattern.group(1) |
| 59 system = frog_pattern.group(2) | 59 system = frog_pattern.group(2) |
| 60 mode = frog_pattern.group(3) | 60 mode = frog_pattern.group(3) |
| 61 | 61 |
| 62 elif web_pattern: | 62 elif web_pattern: |
| 63 name = 'frogium' | 63 name = 'frogium' |
| 64 mode = 'release' | 64 mode = 'release' |
| 65 browser = web_pattern.group(1) | 65 browser = web_pattern.group(1) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 - browser: one of the browsers, see GetBuildInfo | 140 - browser: one of the browsers, see GetBuildInfo |
| 141 - option: 'checked' | 141 - option: 'checked' |
| 142 - flags: extra flags to pass to test.dart | 142 - flags: extra flags to pass to test.dart |
| 143 """ | 143 """ |
| 144 | 144 |
| 145 # Make sure we are in the frog directory | 145 # Make sure we are in the frog directory |
| 146 os.chdir(DART_PATH) | 146 os.chdir(DART_PATH) |
| 147 | 147 |
| 148 if component == 'dart2js': | 148 if component == 'dart2js': |
| 149 if (option == 'checked'): | 149 if (option == 'checked'): |
| 150 flags.append('--timeout=240') | 150 flags.append('--host-checked') |
| 151 # Leg isn't self-hosted (yet) so we run the leg unit tests on the VM. | 151 # Leg isn't self-hosted (yet) so we run the leg unit tests on the VM. |
| 152 TestStep("leg_extra", mode, system, 'vm', ['leg'], flags) | 152 TestStep("leg_extra", mode, system, 'vm', ['leg'], ['--checked']) |
| 153 | 153 |
| 154 extra_suites = ['leg_only', 'frog_native'] | 154 extra_suites = ['leg_only', 'frog_native'] |
| 155 TestStep("leg_extra", mode, system, 'leg', extra_suites, flags) | 155 TestStep("leg_extra", mode, system, 'leg', extra_suites, flags) |
| 156 | 156 |
| 157 TestStep("leg", mode, system, 'leg', [], flags) | 157 TestStep("leg", mode, system, 'leg', [], flags) |
| 158 | 158 |
| 159 elif component != 'frogium': # frog and frogsh | 159 elif component != 'frogium': # frog and frogsh |
| 160 TestStep("frog", mode, system, component, [], flags) | 160 TestStep("frog", mode, system, component, [], flags) |
| 161 TestStep("frog_extra", mode, system, | 161 TestStep("frog_extra", mode, system, |
| 162 component, ['frog', 'frog_native', 'peg', 'css'], flags) | 162 component, ['frog', 'frog_native', 'peg', 'css'], flags) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 shutil.rmtree('C:\\Users\\chrome-bot\\AppData\\Local\\Temp', | 219 shutil.rmtree('C:\\Users\\chrome-bot\\AppData\\Local\\Temp', |
| 220 ignore_errors=True) | 220 ignore_errors=True) |
| 221 elif browser == 'ff': | 221 elif browser == 'ff': |
| 222 # Note: the buildbots run as root, so we can do this without requiring a | 222 # Note: the buildbots run as root, so we can do this without requiring a |
| 223 # password. The command won't actually work on regular machines without | 223 # password. The command won't actually work on regular machines without |
| 224 # root permissions. | 224 # root permissions. |
| 225 _DeleteFirefoxProfiles('/tmp') | 225 _DeleteFirefoxProfiles('/tmp') |
| 226 _DeleteFirefoxProfiles('/var/tmp') | 226 _DeleteFirefoxProfiles('/var/tmp') |
| 227 | 227 |
| 228 def main(): | 228 def main(): |
| 229 print 'main' | |
| 230 if len(sys.argv) == 0: | 229 if len(sys.argv) == 0: |
| 231 print 'Script pathname not known, giving up.' | 230 print 'Script pathname not known, giving up.' |
| 232 return 1 | 231 return 1 |
| 233 | 232 |
| 234 component, mode, system, browser, option = GetBuildInfo() | 233 component, mode, system, browser, option = GetBuildInfo() |
| 235 print "component: %s, mode: %s, system: %s, browser %s" % (component, mode, sy
stem, | 234 print "component: %s, mode: %s, system: %s, browser: %s, option: %s" % ( |
| 236 browser) | 235 component, mode, system, browser, option) |
| 237 if component is None: | 236 if component is None: |
| 238 return 1 | 237 return 1 |
| 239 | 238 |
| 240 status = BuildFrog(component, mode, system) | 239 status = BuildFrog(component, mode, system) |
| 241 if status != 0: | 240 if status != 0: |
| 242 print '@@@STEP_FAILURE@@@' | 241 print '@@@STEP_FAILURE@@@' |
| 243 return status | 242 return status |
| 244 | 243 |
| 245 if component == 'dart2js': | 244 if component == 'dart2js': |
| 246 status = TestFrog(component, mode, system, browser, option, []) | 245 status = TestFrog(component, mode, system, browser, option, []) |
| (...skipping 11 matching lines...) Expand all Loading... |
| 258 if status != 0: | 257 if status != 0: |
| 259 print '@@@STEP_FAILURE@@@' | 258 print '@@@STEP_FAILURE@@@' |
| 260 | 259 |
| 261 if component == 'frogium': | 260 if component == 'frogium': |
| 262 CleanUpTemporaryFiles(system, browser) | 261 CleanUpTemporaryFiles(system, browser) |
| 263 return status | 262 return status |
| 264 | 263 |
| 265 | 264 |
| 266 if __name__ == '__main__': | 265 if __name__ == '__main__': |
| 267 sys.exit(main()) | 266 sys.exit(main()) |
| OLD | NEW |