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 import datetime |
| 6 |
| 7 from recipe_engine import recipe_api |
| 8 from recipe_engine.recipe_api import Property |
| 9 from recipe_engine.types import freeze |
| 10 |
| 11 DEPS = [ |
| 12 'chromium', |
| 13 'depot_tools/bot_update', |
| 14 'depot_tools/gclient', |
| 15 'file', |
| 16 'gsutil', |
| 17 'recipe_engine/path', |
| 18 'recipe_engine/properties', |
| 19 'recipe_engine/python', |
| 20 'recipe_engine/step', |
| 21 ] |
| 22 |
| 23 JSON_OUTPUT_DIR = 'annotated_tests_json_temp' |
| 24 |
| 25 BUCKET_NAME = 'chromium-annotated-tests' |
| 26 BUCKET_PATH = 'android' |
| 27 |
| 28 TEST_APKS = { |
| 29 'android_webview_test_apk': 'AndroidWebViewTest', |
| 30 'blimp_test_apk': 'BlimpTest', |
| 31 'chrome_public_test_apk': 'ChromePublicTest', |
| 32 'chrome_sync_shell_test_apk': 'ChromeSyncShellTest', |
| 33 'content_shell_test_apk': 'ContentShellTest', |
| 34 'system_webview_shell_layout_test_apk': 'SystemWebViewShellLayoutTest', |
| 35 } |
| 36 |
| 37 _EXPORT_TIME_FORMAT = '%Y%m%dT%H%M%S' |
| 38 |
| 39 |
| 40 def RunSteps(api): |
| 41 api.chromium.set_config( |
| 42 'android', BUILD_CONFIG=api.properties.get('configuration', 'Release')) |
| 43 api.gclient.set_config('chromium') |
| 44 api.gclient.apply_config('android') |
| 45 api.bot_update.ensure_checkout() |
| 46 api.gclient.checkout() |
| 47 api.chromium.compile(TEST_APKS.keys()) |
| 48 try: |
| 49 temp_output_dir = api.path.mkdtemp(JSON_OUTPUT_DIR) |
| 50 timestamp = datetime.datetime.utcnow() |
| 51 timestamp_string = timestamp.strftime(_EXPORT_TIME_FORMAT) |
| 52 api.python( |
| 53 'run find_annotated_tests.py', |
| 54 api.path['checkout'].join( |
| 55 'tools', 'android', 'find_annotated_tests.py'), |
| 56 args = [ |
| 57 '--test-apks', ' '.join(TEST_APKS.itervalues()), |
| 58 '--apk-output-dir', api.chromium.output_dir, |
| 59 '--json-output-dir', temp_output_dir, |
| 60 '--timestamp-string', timestamp_string, |
| 61 '-v']) |
| 62 api.gsutil.upload( |
| 63 temp_output_dir.join( |
| 64 '%s-android-chrome.json' % timestamp_string), |
| 65 BUCKET_NAME, BUCKET_PATH) |
| 66 finally: |
| 67 api.file.rmtree('Delete temp out directory', temp_output_dir) |
| 68 |
| 69 |
| 70 def GenTests(api): |
| 71 yield ( |
| 72 api.test( |
| 73 'find_annotated_tests_basic') + |
| 74 api.properties.generic( |
| 75 buildername='Chromium Android Find Annotated Tests', |
| 76 mastername='InfraCron')) |
OLD | NEW |