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

Unified Diff: scripts/slave/recipes/chromedriver/chromedriver_android.py

Issue 1274723004: Converted Android Chromedriver buildbot scripts to recipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: scripts/slave/recipes/chromedriver/chromedriver_android.py
diff --git a/scripts/slave/recipes/chromedriver/chromedriver_android.py b/scripts/slave/recipes/chromedriver/chromedriver_android.py
new file mode 100644
index 0000000000000000000000000000000000000000..bb0da2a10a7c064037ec5d74cc802a06de129c49
--- /dev/null
+++ b/scripts/slave/recipes/chromedriver/chromedriver_android.py
@@ -0,0 +1,116 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from infra.libs.infra_types import freeze
+from recipe_engine import recipe_api
+
+DEPS = [
+ 'adb',
+ 'archive',
+ 'bot_update',
+ 'chromedriver',
+ 'chromium',
+ 'chromium_android',
+ 'commit_position',
+ 'gclient',
+ 'platform',
+ 'properties',
+]
+
+BUILDERS = freeze({
+ 'chromium.fyi': {
+ 'Android ChromeDriver Tests (dbg)': {
+ 'config': 'main_builder',
+ 'target': 'Debug',
+ # Whether or not to update the test results log (Android only).
+ 'update_log': True,
+ 'android_packages': [
+ 'chrome_shell',
+ 'chrome_stable',
+ 'chrome_beta',
+ 'chromedriver_webview_shell',
+ ],
+ 'install_apks': [
+ {
+ 'name': 'ChromeShell.apk',
+ 'package': 'org.chromium.chrome.shell',
samuong 2015/08/28 00:14:47 Don't forget we need to replace this with ChromePu
mikecase (-- gone --) 2016/04/04 21:46:42 Done.
+ },
+ {
+ 'name': 'ChromeDriverWebViewShell.apk',
+ 'package': 'org.chromium.chromedriver_webview_shell',
+ },
+ ]
+ },
+ },
+})
+
+REPO_URL = 'svn://svn-mirror.golo.chromium.org/chrome/trunk/src'
+
+def RunSteps(api):
+ mastername = api.properties['mastername']
+ buildername = api.properties['buildername']
+ builder = BUILDERS[mastername][buildername]
+ api.chromium_android.configure_from_properties(
+ builder['config'],
+ REPO_NAME='src',
+ REPO_URL=REPO_URL,
+ INTERNAL=False,
+ BUILD_CONFIG=builder['target'])
+ android_packages = builder.get('android_packages')
+ update_log = builder.get('update_log')
+ platform = api.chromedriver.get_chromedriver_platform(bool(android_packages))
+
+ api.gclient.set_config('chromium')
+ api.gclient.apply_config('android')
+ api.bot_update.ensure_checkout()
+ api.chromium_android.clean_local_files()
+ api.chromium.runhooks()
+ api.chromium_android.run_tree_truth()
+
+ api.adb.root_devices()
+ api.chromium_android.spawn_logcat_monitor()
+ api.chromium_android.device_status_check()
+ api.chromium_android.provision_devices(
+ min_battery_level=95, disable_network=True, disable_java_debug=True,
+ reboot_timeout=180)
+
+ api.archive.download_and_unzip_build(
+ step_name='extract build',
+ target=api.chromium.c.BUILD_CONFIG,
+ build_url=None,
+ build_archive_url=api.properties.get('parent_build_archive_url'))
+ commit_position = api.commit_position.parse_revision(
+ api.properties['got_revision_cp'])
+
+ if builder['install_apks']:
+ for apk in builder['install_apks']:
+ api.chromium_android.adb_install_apk(
+ apk['name'],
+ apk['package'])
+
+ api.chromedriver.download_prebuilts()
+ passed = api.chromedriver.run_all_tests(
+ android_packages=android_packages)
+ api.chromedriver.archive_server_logs()
+
+ if update_log:
+ api.chromedriver.update_test_results_log(platform, commit_position, passed)
+
+ api.chromium_android.logcat_dump()
+ api.chromium_android.stack_tool_steps()
+ api.chromium_android.test_report()
+
+def GenTests(api):
+ sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s)
+
+ yield (
+ api.test('%s_basic' % sanitize('Android ChromeDriver Tests (dbg)')) +
+ api.properties.generic(
+ buildername='Android ChromeDriver Tests (dbg)',
+ slavename='slavename',
+ mastername='chromium.fyi') +
+ api.properties(
+ parent_build_archive_url='gs://test-domain/test-archive.zip',
+ got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00',
+ got_revision_cp='refs/heads/master@{#333333}'))

Powered by Google App Engine
This is Rietveld 408576698