Index: scripts/slave/recipes/find_annotated_tests.py |
diff --git a/scripts/slave/recipes/find_annotated_tests.py b/scripts/slave/recipes/find_annotated_tests.py |
new file mode 100644 |
index 0000000000000000000000000000000000000000..31d9d8efbbf3e7792dab140fd0c3b1f0f3e5e5d9 |
--- /dev/null |
+++ b/scripts/slave/recipes/find_annotated_tests.py |
@@ -0,0 +1,64 @@ |
+# 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 = [ |
+ 'depot_tools/bot_update', |
+ 'depot_tools/gclient', |
+ 'file', |
+ 'gsutil', |
+ 'recipe_engine/python', |
+ 'recipe_engine/path', |
+ 'recipe_engine/properties', |
+ 'recipe_engine/step', |
+ 'chromium', |
+] |
+ |
+JSON_OUTPUT_DIR = 'annotated_tests_json_temp' |
+ |
+BUCKET_NAME = 'chromium-annotated-tests' |
+BUCKET_PATH = 'android' |
+ |
+TEST_APKS = ['ChromePublicApk'] |
+ |
+_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() |
+ temp_output_dir = api.path.mkdtemp(JSON_OUTPUT_DIR) |
+ script_runtime = datetime.datetime.utcnow() |
+ script_runtime_string = script_runtime.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), |
+ '--apk-output-dir', api.chromium.output_dir, |
+ '--json-output-dir', temp_output_dir, |
+ '--script_runtime_string', script_runtime_string, |
mikecase (-- gone --)
2016/06/14 22:22:50
nit: Chnage to same format as everything else.
sc
the real yoland
2016/06/14 23:27:15
Done
|
+ '-v']) |
+ api.gsutil.upload( |
+ temp_output_dir.join('%s-chrome-android.json' % script_runtime_string), |
+ BUCKET_NAME, BUCKET_PATH) |
+ 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')) |