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 """Dart2js buildbot steps | 7 """Dart2js buildbot steps |
8 | 8 |
9 Runs tests for the dart2js compiler. | 9 Runs tests for the dart2js compiler. |
10 """ | 10 """ |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 TestStep("dart2js", mode, system, 'dart2js', runtime, ['dartc', | 289 TestStep("dart2js", mode, system, 'dart2js', runtime, ['dartc', |
290 'samples', 'standalone', 'corelib', 'co19', 'language', 'isolate', | 290 'samples', 'standalone', 'corelib', 'co19', 'language', 'isolate', |
291 'vm', 'json', 'benchmark_smoke', 'dartdoc', 'utils', 'pub', 'lib'], | 291 'vm', 'json', 'benchmark_smoke', 'dartdoc', 'utils', 'pub', 'lib'], |
292 flags) | 292 flags) |
293 extras = ['dart2js_extra', 'dart2js_native', 'dart2js_foreign'] | 293 extras = ['dart2js_extra', 'dart2js_native', 'dart2js_foreign'] |
294 TestStep("dart2js_extra", mode, system, 'dart2js', runtime, extras, | 294 TestStep("dart2js_extra", mode, system, 'dart2js', runtime, extras, |
295 flags) | 295 flags) |
296 | 296 |
297 return 0 | 297 return 0 |
298 | 298 |
299 def _DeleteFirefoxProfiles(directory): | 299 def _DeleteTempWebdriverProfiles(directory): |
300 """Find all the firefox profiles in a particular directory and delete them.""" | 300 """Find all the firefox profiles in a particular directory and delete them.""" |
301 for f in os.listdir(directory): | 301 for f in os.listdir(directory): |
302 item = os.path.join(directory, f) | 302 item = os.path.join(directory, f) |
303 if os.path.isdir(item) and f.startswith('tmp'): | 303 if os.path.isdir(item) and f.startswith('tmp'): |
304 subprocess.Popen('rm -rf %s' % item, shell=True) | 304 subprocess.Popen('rm -rf %s' % item, shell=True) |
305 | 305 |
306 def CleanUpTemporaryFiles(system, browser): | 306 def CleanUpTemporaryFiles(system, browser): |
307 """For some browser (selenium) tests, the browser creates a temporary profile | 307 """For some browser (selenium) tests, the browser creates a temporary profile |
308 on each browser session start. On Windows, generally these files are | 308 on each browser session start. On Windows, generally these files are |
309 automatically deleted when all python processes complete. However, since our | 309 automatically deleted when all python processes complete. However, since our |
310 buildbot slave script also runs on python, we never get the opportunity to | 310 buildbot slave script also runs on python, we never get the opportunity to |
311 clear out the temp files, so we do so explicitly here. Our batch browser | 311 clear out the temp files, so we do so explicitly here. Our batch browser |
312 testing will make this problem occur much less frequently, but will still | 312 testing will make this problem occur much less frequently, but will still |
313 happen eventually unless we do this. | 313 happen eventually unless we do this. |
314 | 314 |
315 This problem also occurs with batch tests in Firefox. For some reason selenium | 315 This problem also occurs with batch tests in Firefox. For some reason selenium |
316 automatically deletes the temporary profiles for Firefox for one browser, | 316 automatically deletes the temporary profiles for Firefox for one browser, |
317 but not multiple ones when we have many open batch tasks running. This | 317 but not multiple ones when we have many open batch tasks running. This |
318 behavior has not been reproduced outside of the buildbots. | 318 behavior has not been reproduced outside of the buildbots. |
319 | 319 |
320 Args: | 320 Args: |
321 - system: either 'linux', 'mac', or 'win7' | 321 - system: either 'linux', 'mac', or 'win7' |
322 - browser: one of the browsers, see GetBuildInfo | 322 - browser: one of the browsers, see GetBuildInfo |
323 """ | 323 """ |
324 if system == 'win7': | 324 if system == 'win7': |
325 shutil.rmtree('C:\\Users\\chrome-bot\\AppData\\Local\\Temp', | 325 shutil.rmtree('C:\\Users\\chrome-bot\\AppData\\Local\\Temp', |
326 ignore_errors=True) | 326 ignore_errors=True) |
327 elif browser == 'ff': | 327 elif browser == 'ff' or 'opera': |
328 # Note: the buildbots run as root, so we can do this without requiring a | 328 # Note: the buildbots run as root, so we can do this without requiring a |
329 # password. The command won't actually work on regular machines without | 329 # password. The command won't actually work on regular machines without |
330 # root permissions. | 330 # root permissions. |
331 _DeleteFirefoxProfiles('/tmp') | 331 _DeleteTempWebdriverProfiles('/tmp') |
332 _DeleteFirefoxProfiles('/var/tmp') | 332 _DeleteTempWebdriverProfiles('/var/tmp') |
333 | 333 |
334 def ClobberBuilder(mode): | 334 def ClobberBuilder(mode): |
335 """ Clobber the builder before we do the build. | 335 """ Clobber the builder before we do the build. |
336 Args: | 336 Args: |
337 - mode: either 'debug' or 'release' | 337 - mode: either 'debug' or 'release' |
338 """ | 338 """ |
339 cmd = [sys.executable, | 339 cmd = [sys.executable, |
340 './tools/clean_output_directory.py', | 340 './tools/clean_output_directory.py', |
341 '--mode=' + mode] | 341 '--mode=' + mode] |
342 print 'Clobbering %s' % (' '.join(cmd)) | 342 print 'Clobbering %s' % (' '.join(cmd)) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 build_info.is_buildbot, | 404 build_info.is_buildbot, |
405 build_info.test_set) | 405 build_info.test_set) |
406 | 406 |
407 if build_info.runtime != 'd8': CleanUpTemporaryFiles(build_info.system, | 407 if build_info.runtime != 'd8': CleanUpTemporaryFiles(build_info.system, |
408 build_info.runtime) | 408 build_info.runtime) |
409 if status != 0: print '@@@STEP_FAILURE@@@' | 409 if status != 0: print '@@@STEP_FAILURE@@@' |
410 return status | 410 return status |
411 | 411 |
412 if __name__ == '__main__': | 412 if __name__ == '__main__': |
413 sys.exit(main()) | 413 sys.exit(main()) |
OLD | NEW |