Index: scripts/slave/recipes/android/find_annotated_tests.py |
diff --git a/scripts/slave/recipes/android/find_annotated_tests.py b/scripts/slave/recipes/android/find_annotated_tests.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..31f2529c7cb23a44ad7995d5aa9494f7580569e4 |
--- /dev/null |
+++ b/scripts/slave/recipes/android/find_annotated_tests.py |
@@ -0,0 +1,76 @@ |
+# 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. |
+ |
+import datetime |
+ |
+from recipe_engine import recipe_api |
+from recipe_engine.recipe_api import Property |
+from recipe_engine.types import freeze |
+ |
+DEPS = [ |
+ 'chromium', |
+ 'depot_tools/bot_update', |
+ 'depot_tools/gclient', |
+ 'file', |
+ 'gsutil', |
+ 'recipe_engine/path', |
+ 'recipe_engine/properties', |
+ 'recipe_engine/python', |
+ 'recipe_engine/step', |
+] |
+ |
+JSON_OUTPUT_DIR = 'annotated_tests_json_temp' |
+ |
+BUCKET_NAME = 'chromium-annotated-tests' |
+BUCKET_PATH = 'android' |
+ |
+TEST_APKS = { |
+ 'android_webview_test_apk': 'AndroidWebViewTest', |
+ 'blimp_test_apk': 'BlimpTest', |
+ 'chrome_public_test_apk': 'ChromePublicTest', |
+ 'chrome_sync_shell_test_apk': 'ChromeSyncShellTest', |
+ 'content_shell_test_apk': 'ContentShellTest', |
+ 'system_webview_shell_layout_test_apk': 'SystemWebViewShellLayoutTest', |
+} |
+ |
+_EXPORT_TIME_FORMAT = '%Y%m%dT%H%M%S' |
+ |
+ |
+def RunSteps(api): |
+ api.chromium.set_config( |
+ 'android', BUILD_CONFIG=api.properties.get('configuration', 'Release')) |
+ api.gclient.set_config('chromium') |
+ api.gclient.apply_config('android') |
+ api.bot_update.ensure_checkout() |
+ api.gclient.checkout() |
+ api.chromium.compile(TEST_APKS.keys()) |
+ try: |
+ temp_output_dir = api.path.mkdtemp(JSON_OUTPUT_DIR) |
+ timestamp = datetime.datetime.utcnow() |
+ timestamp_string = timestamp.strftime(_EXPORT_TIME_FORMAT) |
+ api.python( |
+ 'run find_annotated_tests.py', |
+ api.path['checkout'].join( |
+ 'tools', 'android', 'find_annotated_tests.py'), |
+ args = [ |
+ '--test-apks', ' '.join(TEST_APKS.itervalues()), |
+ '--apk-output-dir', api.chromium.output_dir, |
+ '--json-output-dir', temp_output_dir, |
+ '--timestamp-string', timestamp_string, |
+ '-v']) |
+ api.gsutil.upload( |
+ temp_output_dir.join( |
+ '%s-android-chrome.json' % timestamp_string), |
+ BUCKET_NAME, BUCKET_PATH) |
+ finally: |
+ api.file.rmtree('Delete temp out directory', temp_output_dir) |
+ |
+ |
+def GenTests(api): |
+ yield ( |
+ api.test( |
+ 'find_annotated_tests_basic') + |
+ api.properties.generic( |
+ buildername='Chromium Android Find Annotated Tests', |
+ mastername='InfraCron')) |