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..e4b0f886cf73eb8edbb0a7f583a2d361d3bef8e6 |
--- /dev/null |
+++ b/scripts/slave/recipes/find_annotated_tests.py |
@@ -0,0 +1,77 @@ |
+# Copyright 2016 The Chromium Authors. All rights reserved. |
jbudorick
2016/06/20 09:28:26
This should almost certainly be in android/ given
the real yoland
2016/06/21 23:16:08
Done
|
+# 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 = { |
+ 'android_webview_test_apk': 'AndroidWebViewTest', |
+ 'blimp_test_apk': 'BlimpTest', |
+ 'chrome_public_test_apk': 'ChromePublicTest', |
+ 'chrome_sync_shell_test_apk': 'ChromeSyncShellTest', |
+ 'components_browsertests_apk': 'ComponentsBrowserTests', |
+ 'content_browsertests_apk': 'ContentBrowserTests', |
+ 'content_shell_test_apk': 'ContentShellTest', |
+ 'system_webview_shell_layout_test_apk': 'SystemWebViewShellLayoutTest', |
mikecase (-- gone --)
2016/06/14 23:43:37
I think you want to remove components_browsertests
jbudorick
2016/06/20 09:28:26
Yeah, you're not going to find any java tests in t
the real yoland
2016/06/21 23:16:08
Got it!
|
+ } |
mikecase (-- gone --)
2016/06/14 23:43:37
nit: I dont think this should be indented.
the real yoland
2016/06/21 23:16:08
Done
|
+ |
+_EXPORT_TIME_FORMAT = '%Y%m%dT%H%M%S' |
+ |
+ |
+def RunSteps(api): |
jbudorick
2016/06/20 09:28:26
I'm not convinced that this needs to be its own re
the real yoland
2016/06/21 23:16:08
The problem with that is I only need this to run a
jbudorick
2016/06/22 10:21:37
To clarify, I'm not saying this shouldn't be it's
|
+ 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.iterkeys()) |
+ try: |
+ 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'), |
mikecase (-- gone --)
2016/06/14 23:43:37
nit: I think this needs to be indented 2 more spac
the real yoland
2016/06/21 23:16:08
Done
|
+ args = [ |
+ '--test-apks', ' '.join(TEST_APKS.itervalues()), |
mikecase (-- gone --)
2016/06/14 23:43:37
These don't have the .apk extension. Is this what
the real yoland
2016/06/21 23:16:08
Ya, the script add the extensions
|
+ '--apk-output-dir', api.chromium.output_dir, |
+ '--json-output-dir', temp_output_dir, |
+ '--script-runtime-string', script_runtime_string, |
+ '-v']) |
+ api.gsutil.upload( |
+ temp_output_dir.join('%s-android-chrome.json' % script_runtime_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') + |
mikecase (-- gone --)
2016/06/14 23:43:37
nit: think this should be indented 2 more spaces
the real yoland
2016/06/21 23:16:08
Done
|
+ api.properties.generic( |
+ buildername='Chromium Android Find Annotated Tests', |
mikecase (-- gone --)
2016/06/14 23:43:37
nit: think this should be indented 2 more spaces.
the real yoland
2016/06/21 23:16:08
Done
|
+ mastername='InfraCron')) |