| OLD | NEW |
| (Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 from recipe_engine import recipe_api |
| 6 from recipe_engine.types import freeze |
| 7 |
| 8 DEPS = [ |
| 9 'adb', |
| 10 'archive', |
| 11 'chromedriver', |
| 12 'chromium', |
| 13 'chromium_android', |
| 14 'commit_position', |
| 15 'depot_tools/bot_update', |
| 16 'depot_tools/gclient', |
| 17 'recipe_engine/platform', |
| 18 'recipe_engine/properties', |
| 19 'recipe_engine/step', |
| 20 ] |
| 21 |
| 22 BUILDERS = freeze({ |
| 23 'chromium.fyi': { |
| 24 'Android ChromeDriver Tests (dbg)': { |
| 25 'chromedriver_platform': 'android', |
| 26 'config': 'main_builder', |
| 27 'target': 'Debug', |
| 28 'update_test_log': True, |
| 29 'android_packages': [ |
| 30 'chrome_beta', |
| 31 'chrome_public', |
| 32 'chrome_stable', |
| 33 'chromedriver_webview_shell', |
| 34 ], |
| 35 'install_apks': [ |
| 36 'ChromeDriverWebViewShell.apk', |
| 37 'ChromePublic.apk', |
| 38 ], |
| 39 }, |
| 40 }, |
| 41 }) |
| 42 |
| 43 REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' |
| 44 |
| 45 def RunSteps(api): |
| 46 mastername = api.properties['mastername'] |
| 47 buildername = api.properties['buildername'] |
| 48 builder = BUILDERS[mastername][buildername] |
| 49 api.chromium_android.configure_from_properties( |
| 50 builder['config'], |
| 51 REPO_NAME='src', |
| 52 REPO_URL=REPO_URL, |
| 53 INTERNAL=False, |
| 54 BUILD_CONFIG=builder['target']) |
| 55 android_packages = builder.get('android_packages') |
| 56 update_test_log = builder.get('update_test_log') |
| 57 platform = builder.get('chromedriver_platform') |
| 58 |
| 59 api.gclient.set_config('chromium') |
| 60 api.gclient.apply_config('android') |
| 61 api.bot_update.ensure_checkout() |
| 62 api.chromium_android.clean_local_files() |
| 63 api.chromium.runhooks() |
| 64 api.chromium_android.run_tree_truth() |
| 65 |
| 66 api.archive.download_and_unzip_build( |
| 67 step_name='extract build', |
| 68 target=api.chromium.c.BUILD_CONFIG, |
| 69 build_url=None, |
| 70 build_archive_url=api.properties.get('parent_build_archive_url')) |
| 71 commit_position = api.commit_position.parse_revision( |
| 72 api.properties['got_revision_cp']) |
| 73 |
| 74 api.chromium_android.common_tests_setup_steps() |
| 75 if builder['install_apks']: |
| 76 for apk in builder['install_apks']: |
| 77 api.chromium_android.adb_install_apk(apk) |
| 78 api.chromedriver.download_prebuilts() |
| 79 |
| 80 passed = True |
| 81 try: |
| 82 api.chromedriver.run_all_tests( |
| 83 android_packages=android_packages, |
| 84 archive_server_logs=True) |
| 85 except api.step.StepFailure: |
| 86 passed = False |
| 87 if update_test_log: |
| 88 api.chromedriver.update_test_results_log(platform, commit_position, passed) |
| 89 |
| 90 api.chromium_android.common_tests_final_steps() |
| 91 |
| 92 def GenTests(api): |
| 93 sanitize = lambda s: ''.join(c if c.isalnum() else '_' for c in s) |
| 94 |
| 95 yield ( |
| 96 api.test('%s_basic' % sanitize('Android ChromeDriver Tests (dbg)')) + |
| 97 api.properties.generic( |
| 98 buildername='Android ChromeDriver Tests (dbg)', |
| 99 slavename='slavename', |
| 100 mastername='chromium.fyi') + |
| 101 api.properties( |
| 102 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 103 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 104 got_revision_cp='refs/heads/master@{#333333}')) |
| 105 |
| 106 yield ( |
| 107 api.test( |
| 108 '%s_test_failure' % sanitize('Android ChromeDriver Tests (dbg)')) + |
| 109 api.properties.generic( |
| 110 buildername='Android ChromeDriver Tests (dbg)', |
| 111 slavename='slavename', |
| 112 mastername='chromium.fyi') + |
| 113 api.properties( |
| 114 parent_build_archive_url='gs://test-domain/test-archive.zip', |
| 115 got_revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', |
| 116 got_revision_cp='refs/heads/master@{#333333}') + |
| 117 api.step_data('java_tests(chrome_stable)', retcode=1)) |
| OLD | NEW |