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 """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 FROG_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 20 DART_PATH = os.path.dirname( |
| 21 os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| 21 | 22 |
| 22 FROG_BUILDER = r'(frog|frogsh)-(linux|mac|windows)-(debug|release)' | 23 FROG_BUILDER = r'(frog|frogsh)-(linux|mac|windows)-(debug|release)' |
| 23 WEB_BUILDER = r'web-(ie|ff|safari|chrome|opera)-(win7|win8|mac|linux)(-(\d+))?' | 24 WEB_BUILDER = r'web-(ie|ff|safari|chrome|opera)-(win7|win8|mac|linux)(-(\d+))?' |
| 24 | 25 |
| 25 NO_COLOR_ENV = dict(os.environ) | 26 NO_COLOR_ENV = dict(os.environ) |
| 26 NO_COLOR_ENV['TERM'] = 'nocolor' | 27 NO_COLOR_ENV['TERM'] = 'nocolor' |
| 27 | 28 |
| 28 def GetBuildInfo(): | 29 def GetBuildInfo(): |
| 29 """Returns a tuple (name, mode, system) where: | 30 """Returns a tuple (name, mode, system) where: |
| 30 - name: 'frog', 'frogsh', 'frogium', or None when the builder has an | 31 - name: 'frog', 'frogsh', 'frogium', or None when the builder has an |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 return component in ['frogsh', 'frogium', 'legium', 'webdriver'] | 69 return component in ['frogsh', 'frogium', 'legium', 'webdriver'] |
| 69 | 70 |
| 70 def TestStep(name, mode, system, component, targets, flags): | 71 def TestStep(name, mode, system, component, targets, flags): |
| 71 print '@@@BUILD_STEP %s tests: %s %s@@@' % (name, component, ' '.join(flags)) | 72 print '@@@BUILD_STEP %s tests: %s %s@@@' % (name, component, ' '.join(flags)) |
| 72 sys.stdout.flush() | 73 sys.stdout.flush() |
| 73 if ComponentsNeedsXterm(component) and system == 'linux': | 74 if ComponentsNeedsXterm(component) and system == 'linux': |
| 74 cmd = ['xvfb-run', '-a'] | 75 cmd = ['xvfb-run', '-a'] |
| 75 else: | 76 else: |
| 76 cmd = [] | 77 cmd = [] |
| 77 | 78 |
| 78 cmd = (cmd | 79 cmd.extend([sys.executable, |
| 79 + [sys.executable, | 80 os.path.join(os.curdir, 'tools', 'test.py'), |
| 80 os.path.join('..', 'tools', 'test.py'), | 81 '--mode=' + mode, |
| 81 '--mode=' + mode, | 82 '--component=' + component, |
| 82 '--component=' + component, | 83 '--time', |
| 83 '--time', | 84 '--report', |
| 84 '--report', | 85 '--progress=buildbot', |
| 85 '--progress=buildbot', | 86 '-v']) |
| 86 '-v'] | |
| 87 + targets) | |
| 88 if flags: | 87 if flags: |
| 89 cmd.extend(flags) | 88 cmd.extend(flags) |
| 89 cmd.extend(targets) | |
| 90 | 90 |
| 91 print 'running %s' % (' '.join(cmd)) | |
|
Emily Fortuna
2012/03/13 17:11:32
Do we want this print statement here?
ahe
2012/03/14 07:26:26
I think we do. I have heard complaints that it is
| |
| 91 exit_code = subprocess.call(cmd, env=NO_COLOR_ENV) | 92 exit_code = subprocess.call(cmd, env=NO_COLOR_ENV) |
| 92 if exit_code != 0: | 93 if exit_code != 0: |
| 93 print '@@@STEP_FAILURE@@@' | 94 print '@@@STEP_FAILURE@@@' |
| 94 return exit_code | 95 return exit_code |
| 95 | 96 |
| 96 | 97 |
| 97 def BuildFrog(component, mode, system): | 98 def BuildFrog(component, mode, system): |
| 98 """ build frog. | 99 """ build frog. |
| 99 Args: | 100 Args: |
| 100 - component: either 'leg', 'frog', 'frogsh' (frog self-hosted), 'frogium' | 101 - component: either 'leg', 'frog', 'frogsh' (frog self-hosted), 'frogium' |
| 101 or 'legium' | 102 or 'legium' |
| 102 - mode: either 'debug' or 'release' | 103 - mode: either 'debug' or 'release' |
| 103 - system: either 'linux', 'mac', or 'win7' | 104 - system: either 'linux', 'mac', or 'win7' |
| 104 """ | 105 """ |
| 105 | 106 |
| 106 # Make sure we are in the frog directory | 107 os.chdir(DART_PATH) |
| 107 os.chdir(FROG_PATH) | |
| 108 | 108 |
| 109 print '@@@BUILD_STEP build frog@@@' | 109 print '@@@BUILD_STEP build frog@@@' |
| 110 | 110 |
| 111 args = [sys.executable, '../tools/build.py', '--mode=' + mode] | 111 args = [sys.executable, './tools/build.py', '--mode=' + mode] |
| 112 return subprocess.call(args, env=NO_COLOR_ENV) | 112 return subprocess.call(args, env=NO_COLOR_ENV) |
| 113 | 113 |
| 114 | 114 |
| 115 def TestFrog(component, mode, system, browser, flags): | 115 def TestFrog(component, mode, system, browser, flags): |
| 116 """ test frog. | 116 """ test frog. |
| 117 Args: | 117 Args: |
| 118 - component: either 'leg', 'frog', 'frogsh' (frog self-hosted), 'frogium', | 118 - component: either 'leg', 'frog', 'frogsh' (frog self-hosted), 'frogium', |
| 119 or 'legium' | 119 or 'legium' |
| 120 - mode: either 'debug' or 'release' | 120 - mode: either 'debug' or 'release' |
| 121 - system: either 'linux', 'mac', or 'win7' | 121 - system: either 'linux', 'mac', or 'win7' |
| 122 - browser: one of the browsers, see GetBuildInfo | 122 - browser: one of the browsers, see GetBuildInfo |
| 123 - flags: extra flags to pass to test.dart | 123 - flags: extra flags to pass to test.dart |
| 124 """ | 124 """ |
| 125 | 125 |
| 126 # Make sure we are in the frog directory | 126 # Make sure we are in the frog directory |
| 127 os.chdir(FROG_PATH) | 127 os.chdir(DART_PATH) |
| 128 | 128 |
| 129 if component != 'frogium': # frog and frogsh | 129 if component != 'frogium': # frog and frogsh |
| 130 if (component == 'frog' and mode == 'release'): | |
| 131 flags.append('--timeout=120') | |
| 130 TestStep("frog", mode, system, component, [], flags) | 132 TestStep("frog", mode, system, component, [], flags) |
| 131 TestStep("frog_extra", mode, system, | 133 TestStep("frog_extra", mode, system, |
| 132 component, ['frog', 'frog_native', 'peg', 'css'], flags) | 134 component, ['frog', 'frog_native', 'peg', 'css'], flags) |
| 133 TestStep("sdk", mode, system, | 135 TestStep("sdk", mode, system, |
| 134 'vm', ['dartdoc'], flags) | 136 'vm', ['dartdoc'], flags) |
| 135 | 137 |
| 136 if not '--checked' in flags: | 138 if not '--checked' in flags: |
| 137 TestStep("leg", mode, system, 'leg', [], flags) | 139 TestStep("leg", mode, system, 'leg', [], flags) |
| 138 TestStep("leg_extra", mode, system, 'leg', | 140 TestStep("leg_extra", mode, system, 'leg', |
| 139 ['leg_only', 'frog_native'], flags) | 141 ['leg_only', 'frog_native'], flags) |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 if status != 0: | 231 if status != 0: |
| 230 print '@@@STEP_FAILURE@@@' | 232 print '@@@STEP_FAILURE@@@' |
| 231 | 233 |
| 232 if component == 'frogium': | 234 if component == 'frogium': |
| 233 CleanUpTemporaryFiles(system, browser) | 235 CleanUpTemporaryFiles(system, browser) |
| 234 return status | 236 return status |
| 235 | 237 |
| 236 | 238 |
| 237 if __name__ == '__main__': | 239 if __name__ == '__main__': |
| 238 sys.exit(main()) | 240 sys.exit(main()) |
| OLD | NEW |