Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Side by Side Diff: frog/scripts/buildbot_annotated_steps.py

Issue 10239010: Make test.dart respect the requested order of test suites, and also split up IE (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/test.dart » ('j') | tools/test.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 or dart2js compiler. 9 Runs tests for the frog or dart2js compiler.
10 """ 10 """
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 args, _ = parser.parse_args() 45 args, _ = parser.parse_args()
46 46
47 compiler = None 47 compiler = None
48 runtime = None 48 runtime = None
49 mode = None 49 mode = None
50 system = None 50 system = None
51 builder_name = os.environ.get(BUILDER_NAME) 51 builder_name = os.environ.get(BUILDER_NAME)
52 option = None 52 option = None
53 shard_index = None 53 shard_index = None
54 total_shards = None 54 total_shards = None
55 number = None
55 if not builder_name: 56 if not builder_name:
56 # We are not running on a buildbot. 57 # We are not running on a buildbot.
57 if args.name: 58 if args.name:
58 builder_name = args.name 59 builder_name = args.name
59 else: 60 else:
60 print 'Use -n $BUILDBOT_NAME for the bot you would like to emulate.' 61 print 'Use -n $BUILDBOT_NAME for the bot you would like to emulate.'
61 sys.exit(1) 62 sys.exit(1)
62 63
63 if builder_name: 64 if builder_name:
64 65
(...skipping 28 matching lines...) Expand all
93 94
94 if system == 'windows': 95 if system == 'windows':
95 system = 'win7' 96 system = 'win7'
96 97
97 if (system == 'win7' and platform.system() != 'Windows') or ( 98 if (system == 'win7' and platform.system() != 'Windows') or (
98 system == 'mac' and platform.system() != 'Darwin') or ( 99 system == 'mac' and platform.system() != 'Darwin') or (
99 system == 'linux' and platform.system() != 'Linux'): 100 system == 'linux' and platform.system() != 'Linux'):
100 print ('Error: You cannot emulate a buildbot with a platform different ' 101 print ('Error: You cannot emulate a buildbot with a platform different '
101 'from your own.') 102 'from your own.')
102 sys.exit(1) 103 sys.exit(1)
103 return (compiler, runtime, mode, system, option, shard_index, total_shards) 104 return (compiler, runtime, mode, system, option, shard_index, total_shards,
105 number)
104 106
105 107
106 def NeedsXterm(compiler, runtime): 108 def NeedsXterm(compiler, runtime):
107 return runtime in ['ie', 'chrome', 'safari', 'opera', 'ff', 'drt'] 109 return runtime in ['ie', 'chrome', 'safari', 'opera', 'ff', 'drt']
108 110
109 def TestStep(name, mode, system, compiler, runtime, targets, flags): 111 def TestStep(name, mode, system, compiler, runtime, targets, flags):
110 print '@@@BUILD_STEP %s %s tests: %s %s@@@' % (name, compiler, runtime, 112 print '@@@BUILD_STEP %s %s tests: %s %s@@@' % (name, compiler, runtime,
111 ' '.join(flags)) 113 ' '.join(flags))
112 sys.stdout.flush() 114 sys.stdout.flush()
113 if NeedsXterm(compiler, runtime) and system == 'linux': 115 if NeedsXterm(compiler, runtime) and system == 'linux':
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 164
163 os.chdir(DART_PATH) 165 os.chdir(DART_PATH)
164 166
165 print '@@@BUILD_STEP build frog@@@' 167 print '@@@BUILD_STEP build frog@@@'
166 168
167 args = [sys.executable, './tools/build.py', '--mode=' + mode, 'dart2js'] 169 args = [sys.executable, './tools/build.py', '--mode=' + mode, 'dart2js']
168 print 'running %s' % (' '.join(args)) 170 print 'running %s' % (' '.join(args))
169 return subprocess.call(args, env=NO_COLOR_ENV) 171 return subprocess.call(args, env=NO_COLOR_ENV)
170 172
171 173
172 def TestFrog(compiler, runtime, mode, system, option, flags): 174 def TestFrog(compiler, runtime, mode, system, option, flags, bot_number=None):
173 """ test frog. 175 """ test frog.
174 Args: 176 Args:
175 - compiler: either 'dart2js' or 'frog' 177 - compiler: either 'dart2js' or 'frog'
176 - runtime: either 'd8', or one of the browsers, see GetBuildInfo 178 - runtime: either 'd8', or one of the browsers, see GetBuildInfo
177 - mode: either 'debug' or 'release' 179 - mode: either 'debug' or 'release'
178 - system: either 'linux', 'mac', or 'win7' 180 - system: either 'linux', 'mac', or 'win7'
179 - option: 'checked' 181 - option: 'checked'
180 - flags: extra flags to pass to test.dart 182 - flags: extra flags to pass to test.dart
183 - bot_number: (optional) Number of the buildbot. Used for dividing test
184 sets between bots.
181 """ 185 """
182 186
183 # Make sure we are in the frog directory 187 # Make sure we are in the frog directory
184 os.chdir(DART_PATH) 188 os.chdir(DART_PATH)
185 189
186 if compiler == 'dart2js': 190 if compiler == 'dart2js':
187 if (option == 'checked'): 191 if (option == 'checked'):
188 flags.append('--host-checked') 192 flags.append('--host-checked')
189 # Leg isn't self-hosted (yet) so we run the leg unit tests on the VM. 193 # Leg isn't self-hosted (yet) so we run the leg unit tests on the VM.
190 TestStep("dart2js_unit", mode, system, 'none', 'vm', ['leg'], ['--checked']) 194 TestStep("dart2js_unit", mode, system, 'none', 'vm', ['leg'], ['--checked'])
191 195
192 extra_suites = ['leg_only', 'frog_native'] 196 extra_suites = ['leg_only', 'frog_native']
193 TestStep("dart2js_extra", mode, system, 'dart2js', runtime, extra_suites, 197 TestStep("dart2js_extra", mode, system, 'dart2js', runtime, extra_suites,
194 flags) 198 flags)
195 199
196 TestStep("dart2js", mode, system, 'dart2js', runtime, [], flags) 200 TestStep("dart2js", mode, system, 'dart2js', runtime, [], flags)
197 201
198 elif runtime == 'd8' and compiler in ['frog']: 202 elif runtime == 'd8' and compiler in ['frog']:
199 TestStep("frog", mode, system, compiler, runtime, [], flags) 203 TestStep("frog", mode, system, compiler, runtime, [], flags)
200 TestStep("frog_extra", mode, system, compiler, runtime, 204 TestStep("frog_extra", mode, system, compiler, runtime,
201 ['frog', 'frog_native', 'peg', 'css'], flags) 205 ['frog', 'frog_native', 'peg', 'css'], flags)
202 TestStep("sdk", mode, system, 'none', 'vm', ['dartdoc'], flags) 206 TestStep("sdk", mode, system, 'none', 'vm', ['dartdoc'], flags)
203 207
204 else: 208 else:
205 tests = ['client', 'language', 'corelib', 'isolate', 'frog', 209 tests = ['client', 'isolate', 'frog', 'css', 'corelib', 'language'
206 'frog_native', 'peg', 'css'] 210 'frog_native', 'peg']
207 211
208 # TODO(efortuna): Move Mac back to DumpRenderTree when we have a more stable 212 # TODO(efortuna): Move Mac back to DumpRenderTree when we have a more stable
209 # solution for DRT. Right now DRT is flakier than regular Chrome for the 213 # solution for DRT. Right now DRT is flakier than regular Chrome for the
210 # isolate tests, so we're switching to use Chrome in the short term. 214 # isolate tests, so we're switching to use Chrome in the short term.
211 if runtime == 'chrome' and system == 'linux': 215 if runtime == 'chrome' and system == 'linux':
212 TestStep('browser', mode, system, 'frog', 'drt', tests, flags) 216 TestStep('browser', mode, system, 'frog', 'drt', tests, flags)
213 TestStep('browser_dart2js', mode, system, 'dart2js', 'drt', [], flags) 217 TestStep('browser_dart2js', mode, system, 'dart2js', 'drt', [], flags)
214 TestStep('browser_dart2js_extra', mode, system, 'dart2js', 'drt', 218 TestStep('browser_dart2js_extra', mode, system, 'dart2js', 'drt',
215 ['leg_only', 'frog_native'], flags) 219 ['leg_only', 'frog_native'], flags)
216 else: 220 else:
217 additional_flags = [] 221 additional_flags = []
218 if system.startswith('win') and runtime == 'ie': 222 if system.startswith('win') and runtime == 'ie':
219 # There should not be more than one InternetExplorerDriver instance 223 # There should not be more than one InternetExplorerDriver instance
220 # running at a time. For details, see 224 # running at a time. For details, see
221 # http://code.google.com/p/selenium/wiki/InternetExplorerDriver. 225 # http://code.google.com/p/selenium/wiki/InternetExplorerDriver.
222 additional_flags += ['-j1'] 226 additional_flags += ['-j1']
227 # The IE bots are slow lately. Split up the tests they do.
228 if bot_number == '2':
229 tests = ['corelib', 'language']
230 else:
231 tests = ['client', 'isolate', 'frog', 'css', 'frog_native', 'peg']
223 TestStep(runtime, mode, system, compiler, runtime, tests, 232 TestStep(runtime, mode, system, compiler, runtime, tests,
224 flags + additional_flags) 233 flags + additional_flags)
225 234
226 return 0 235 return 0
227 236
228 def _DeleteFirefoxProfiles(directory): 237 def _DeleteFirefoxProfiles(directory):
229 """Find all the firefox profiles in a particular directory and delete them.""" 238 """Find all the firefox profiles in a particular directory and delete them."""
230 for f in os.listdir(directory): 239 for f in os.listdir(directory):
231 item = os.path.join(directory, f) 240 item = os.path.join(directory, f)
232 if os.path.isdir(item) and f.startswith('tmp'): 241 if os.path.isdir(item) and f.startswith('tmp'):
(...skipping 25 matching lines...) Expand all
258 # password. The command won't actually work on regular machines without 267 # password. The command won't actually work on regular machines without
259 # root permissions. 268 # root permissions.
260 _DeleteFirefoxProfiles('/tmp') 269 _DeleteFirefoxProfiles('/tmp')
261 _DeleteFirefoxProfiles('/var/tmp') 270 _DeleteFirefoxProfiles('/var/tmp')
262 271
263 def main(): 272 def main():
264 if len(sys.argv) == 0: 273 if len(sys.argv) == 0:
265 print 'Script pathname not known, giving up.' 274 print 'Script pathname not known, giving up.'
266 return 1 275 return 1
267 276
268 compiler, runtime, mode, system, option, shard_index, total_shards = ( 277 compiler, runtime, mode, system, option, shard_index, total_shards, number = (
269 GetBuildInfo()) 278 GetBuildInfo())
270 shard_description = "" 279 shard_description = ""
271 if shard_index: 280 if shard_index:
272 shard_description = " shard %s of %s" % (shard_index, total_shards) 281 shard_description = " shard %s of %s" % (shard_index, total_shards)
273 print "compiler: %s, runtime: %s mode: %s, system: %s, option: %s%s" % ( 282 print "compiler: %s, runtime: %s mode: %s, system: %s, option: %s%s" % (
274 compiler, runtime, mode, system, option, shard_description) 283 compiler, runtime, mode, system, option, shard_description)
275 if compiler is None: 284 if compiler is None:
276 return 1 285 return 1
277 286
278 status = BuildFrog(compiler, mode, system) 287 status = BuildFrog(compiler, mode, system)
279 if status != 0: 288 if status != 0:
280 print '@@@STEP_FAILURE@@@' 289 print '@@@STEP_FAILURE@@@'
281 return status 290 return status
282 test_flags = [] 291 test_flags = []
283 if shard_index: 292 if shard_index:
284 test_flags = ['--shards=%s' % total_shards, '--shard=%s' % shard_index] 293 test_flags = ['--shards=%s' % total_shards, '--shard=%s' % shard_index]
285 if compiler == 'dart2js': 294 if compiler == 'dart2js':
286 status = TestFrog(compiler, runtime, mode, system, option, test_flags) 295 status = TestFrog(compiler, runtime, mode, system, option, test_flags,
296 number)
287 if status != 0: 297 if status != 0:
288 print '@@@STEP_FAILURE@@@' 298 print '@@@STEP_FAILURE@@@'
289 return status # Return unconditionally for dart2js. 299 return status # Return unconditionally for dart2js.
290 300
291 if runtime == 'd8' or (system == 'linux' and runtime == 'chrome'): 301 if runtime == 'd8' or (system == 'linux' and runtime == 'chrome'):
292 status = TestFrog(compiler, runtime, mode, system, option, test_flags) 302 status = TestFrog(compiler, runtime, mode, system, option, test_flags,
303 number)
293 if status != 0: 304 if status != 0:
294 print '@@@STEP_FAILURE@@@' 305 print '@@@STEP_FAILURE@@@'
295 return status 306 return status
296 307
297 status = TestFrog(compiler, runtime, mode, system, option, 308 status = TestFrog(compiler, runtime, mode, system, option,
298 test_flags + ['--checked']) 309 test_flags + ['--checked'], number)
299 if status != 0: 310 if status != 0:
300 print '@@@STEP_FAILURE@@@' 311 print '@@@STEP_FAILURE@@@'
301 312
302 if compiler == 'frog' and runtime in ['ff', 'chrome', 'safari', 'opera', 313 if compiler == 'frog' and runtime in ['ff', 'chrome', 'safari', 'opera',
303 'ie', 'drt']: 314 'ie', 'drt']:
304 CleanUpTemporaryFiles(system, runtime) 315 CleanUpTemporaryFiles(system, runtime)
305 return status 316 return status
306 317
307 318
308 if __name__ == '__main__': 319 if __name__ == '__main__':
309 sys.exit(main()) 320 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | tools/test.dart » ('j') | tools/test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698