| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """ | 6 """ |
| 7 Dartium on Android buildbot steps. | 7 Dartium on Android buildbot steps. |
| 8 | 8 |
| 9 Runs steps after the buildbot builds Dartium on Android, | 9 Runs steps after the buildbot builds Dartium on Android, |
| 10 which should upload the APK to an attached device, and run | 10 which should upload the APK to an attached device, and run |
| 11 Dart and chromium tests on it. | 11 Dart and chromium tests on it. |
| 12 """ | 12 """ |
| 13 | 13 |
| 14 import optparse | 14 import optparse |
| 15 import os | 15 import os |
| 16 import string | 16 import string |
| 17 import subprocess |
| 17 import sys | 18 import sys |
| 18 | 19 |
| 19 import bot | 20 import bot |
| 20 import bot_utils | 21 import bot_utils |
| 21 | 22 |
| 22 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 23 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 23 sys.path.append(os.path.join(SCRIPT_DIR, '..')) | 24 sys.path.append(os.path.join(SCRIPT_DIR, '..')) |
| 24 import utils | 25 import utils |
| 25 | 26 |
| 26 CS_LOCATION = 'apks/ContentShell.apk' | 27 CS_LOCATION = 'apks/ContentShell.apk' |
| (...skipping 21 matching lines...) Expand all Loading... |
| 48 local = os.path.join(options.build_products_dir, CS_LOCATION) | 49 local = os.path.join(options.build_products_dir, CS_LOCATION) |
| 49 # TODO(whesse): pass in arch and mode from reciepe | 50 # TODO(whesse): pass in arch and mode from reciepe |
| 50 remote = namer.dartium_android_apk_filepath(revision, | 51 remote = namer.dartium_android_apk_filepath(revision, |
| 51 'content_shell-android', | 52 'content_shell-android', |
| 52 'arm', | 53 'arm', |
| 53 'release') | 54 'release') |
| 54 content_shell_link = string.replace(remote, 'gs://', web_link_prefix) | 55 content_shell_link = string.replace(remote, 'gs://', web_link_prefix) |
| 55 UploadSetACL(gsutil, local, remote) | 56 UploadSetACL(gsutil, local, remote) |
| 56 print "Uploaded content shell, available from: %s" % content_shell_link | 57 print "Uploaded content shell, available from: %s" % content_shell_link |
| 57 | 58 |
| 59 |
| 60 def RunContentShellTests(options): |
| 61 with bot.BuildStep('ContentShell tests'): |
| 62 subprocess.check_call([os.path.join(SCRIPT_DIR, 'run_android_tests.sh'), |
| 63 os.path.join(options.build_products_dir, CS_LOCATION)]) |
| 64 |
| 65 |
| 58 def main(): | 66 def main(): |
| 59 if sys.platform != 'linux2': | 67 if sys.platform != 'linux2': |
| 60 print "This script was only tested on linux. Please run it on linux!" | 68 print "This script was only tested on linux. Please run it on linux!" |
| 61 sys.exit(1) | 69 sys.exit(1) |
| 62 | 70 |
| 63 parser = GetOptionsParser() | 71 parser = GetOptionsParser() |
| 64 (options, args) = parser.parse_args() | 72 (options, args) = parser.parse_args() |
| 65 | 73 |
| 66 if not options.build_products_dir: | 74 if not options.build_products_dir: |
| 67 print "No build products directory given." | 75 print "No build products directory given." |
| 68 sys.exit(1) | 76 sys.exit(1) |
| 69 | 77 |
| 70 UploadAPKs(options) | 78 UploadAPKs(options) |
| 79 RunContentShellTests(options) |
| 71 sys.exit(0) | 80 sys.exit(0) |
| 72 | 81 |
| 73 if __name__ == '__main__': | 82 if __name__ == '__main__': |
| 74 main() | 83 main() |
| OLD | NEW |