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

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

Issue 1274723004: Converted Android Chromedriver buildbot scripts to recipes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Fixed nits. Created 4 years, 5 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.py
diff --git a/scripts/slave/recipes/chromedriver.py b/scripts/slave/recipes/chromedriver.py
new file mode 100644
index 0000000000000000000000000000000000000000..03178aebb9bcba958bf986a70bc3b94377527cd7
--- /dev/null
+++ b/scripts/slave/recipes/chromedriver.py
@@ -0,0 +1,117 @@
+# Copyright 2016 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 recipe_engine import recipe_api
+from recipe_engine.types import freeze
+
+DEPS = [
+ 'adb',
+ 'archive',
+ 'chromedriver',
+ 'chromium',
+ 'chromium_android',
+ 'commit_position',
+ 'depot_tools/bot_update',
+ 'depot_tools/gclient',
+ 'recipe_engine/platform',
+ 'recipe_engine/properties',
+ 'recipe_engine/step',
+]
+
+BUILDERS = freeze({
+ 'chromium.fyi': {
+ 'Android ChromeDriver Tests (dbg)': {
+ 'chromedriver_platform': 'android',
+ 'config': 'main_builder',
+ 'target': 'Debug',
+ 'update_test_log': True,
+ 'android_packages': [
+ 'chrome_beta',
+ 'chrome_public',
+ 'chrome_stable',
+ 'chromedriver_webview_shell',
+ ],
+ 'install_apks': [
+ 'ChromeDriverWebViewShell.apk',
+ 'ChromePublic.apk',
+ ],
+ },
+ },
+})
+
+REPO_URL = 'https://chromium.googlesource.com/chromium/src.git'
+
+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_test_log = builder.get('update_test_log')
+ platform = builder.get('chromedriver_platform')
+
+ 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.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'])
+
+ api.chromium_android.common_tests_setup_steps()
+ if builder['install_apks']:
+ for apk in builder['install_apks']:
+ api.chromium_android.adb_install_apk(apk)
+ api.chromedriver.download_prebuilts()
+
+ passed = True
+ try:
+ api.chromedriver.run_all_tests(
+ android_packages=android_packages,
+ archive_server_logs=True)
+ except api.step.StepFailure:
+ passed = False
+ if update_test_log:
+ api.chromedriver.update_test_results_log(platform, commit_position, passed)
+
+ api.chromium_android.common_tests_final_steps()
+
+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}'))
+
+ yield (
+ api.test(
+ '%s_test_failure' % 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}') +
+ api.step_data('java_tests(chrome_stable)', retcode=1))

Powered by Google App Engine
This is Rietveld 408576698