| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import collections | 6 import collections |
| 7 import glob | 7 import glob |
| 8 import hashlib | 8 import hashlib |
| 9 import multiprocessing | 9 import multiprocessing |
| 10 import os | 10 import os |
| 11 import random | 11 import random |
| 12 import re |
| 12 import shutil | 13 import shutil |
| 13 import sys | 14 import sys |
| 14 | 15 |
| 15 import bb_utils | 16 import bb_utils |
| 16 import bb_annotations | 17 import bb_annotations |
| 17 | 18 |
| 18 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) | 19 sys.path.append(os.path.join(os.path.dirname(__file__), '..')) |
| 19 import provision_devices | 20 import provision_devices |
| 20 from pylib import android_commands | 21 from pylib import android_commands |
| 21 from pylib import constants | 22 from pylib import constants |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 ['--additional-expectations=%s' % os.path.join(CHROME_SRC_DIR, *f)]) | 248 ['--additional-expectations=%s' % os.path.join(CHROME_SRC_DIR, *f)]) |
| 248 | 249 |
| 249 RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py'] + cmd_args) | 250 RunCmd(['webkit/tools/layout_tests/run_webkit_tests.py'] + cmd_args) |
| 250 | 251 |
| 251 if options.factory_properties.get('archive_webkit_results', False): | 252 if options.factory_properties.get('archive_webkit_results', False): |
| 252 bb_annotations.PrintNamedStep('archive_webkit_results') | 253 bb_annotations.PrintNamedStep('archive_webkit_results') |
| 253 base = 'https://storage.googleapis.com/chromium-layout-test-archives' | 254 base = 'https://storage.googleapis.com/chromium-layout-test-archives' |
| 254 builder_name = options.build_properties.get('buildername', '') | 255 builder_name = options.build_properties.get('buildername', '') |
| 255 build_number = str(options.build_properties.get('buildnumber', '')) | 256 build_number = str(options.build_properties.get('buildnumber', '')) |
| 256 bb_annotations.PrintLink('results', | 257 bb_annotations.PrintLink('results', |
| 257 '%s/%s/%s/layout-test-results/results.html' % (base, builder_name, | 258 '%s/%s/%s/layout-test-results/results.html' % ( |
| 258 build_number)) | 259 base, EscapeBuilderName(builder_name), build_number)) |
| 259 bb_annotations.PrintLink('(zip)', | 260 bb_annotations.PrintLink('(zip)', '%s/%s/%s/layout-test-results.zip' % ( |
| 260 '%s/%s/%s/layout-test-results.zip' % (base, builder_name, | 261 base, EscapeBuilderName(builder_name), build_number)) |
| 261 build_number)) | |
| 262 gs_bucket = 'gs://chromium-layout-test-archives' | 262 gs_bucket = 'gs://chromium-layout-test-archives' |
| 263 RunCmd([os.path.join(SLAVE_SCRIPTS_DIR, 'chromium', | 263 RunCmd([os.path.join(SLAVE_SCRIPTS_DIR, 'chromium', |
| 264 'archive_layout_test_results.py'), | 264 'archive_layout_test_results.py'), |
| 265 '--results-dir', '../../layout-test-results', | 265 '--results-dir', '../../layout-test-results', |
| 266 '--build-dir', CHROME_OUT_DIR, | 266 '--build-dir', CHROME_OUT_DIR, |
| 267 '--build-number', build_number, | 267 '--build-number', build_number, |
| 268 '--builder-name', builder_name, | 268 '--builder-name', builder_name, |
| 269 '--gs-bucket', gs_bucket]) | 269 '--gs-bucket', gs_bucket]) |
| 270 | 270 |
| 271 | 271 |
| 272 def EscapeBuilderName(builder_name): |
| 273 return re.sub('[ ()]', '_', builder_name) |
| 274 |
| 275 |
| 272 def SpawnLogcatMonitor(): | 276 def SpawnLogcatMonitor(): |
| 273 shutil.rmtree(LOGCAT_DIR, ignore_errors=True) | 277 shutil.rmtree(LOGCAT_DIR, ignore_errors=True) |
| 274 bb_utils.SpawnCmd([ | 278 bb_utils.SpawnCmd([ |
| 275 os.path.join(CHROME_SRC_DIR, 'build', 'android', 'adb_logcat_monitor.py'), | 279 os.path.join(CHROME_SRC_DIR, 'build', 'android', 'adb_logcat_monitor.py'), |
| 276 LOGCAT_DIR]) | 280 LOGCAT_DIR]) |
| 277 | 281 |
| 278 # Wait for logcat_monitor to pull existing logcat | 282 # Wait for logcat_monitor to pull existing logcat |
| 279 RunCmd(['sleep', '5']) | 283 RunCmd(['sleep', '5']) |
| 280 | 284 |
| 281 def ProvisionDevices(options): | 285 def ProvisionDevices(options): |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) | 483 setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
| 480 if options.coverage_bucket: | 484 if options.coverage_bucket: |
| 481 setattr(options, 'coverage_dir', | 485 setattr(options, 'coverage_dir', |
| 482 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) | 486 os.path.join(CHROME_OUT_DIR, options.target, 'coverage')) |
| 483 | 487 |
| 484 MainTestWrapper(options) | 488 MainTestWrapper(options) |
| 485 | 489 |
| 486 | 490 |
| 487 if __name__ == '__main__': | 491 if __name__ == '__main__': |
| 488 sys.exit(main(sys.argv)) | 492 sys.exit(main(sys.argv)) |
| OLD | NEW |