Chromium Code Reviews| 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..14b67b1be692277f2d880b10fd5554d3779fec6f |
| --- /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() |
|
mikecase (-- gone --)
2016/06/14 22:22:51
As discussed, may need to add a compile step.
the real yoland
2016/06/14 23:27:15
Done
|
| + temp_output_dir = api.path.mkdtemp(JSON_OUTPUT_DIR) |
|
mikecase (-- gone --)
2016/06/14 22:22:51
May want this in a try block, and the delete rmtre
the real yoland
2016/06/14 23:27:15
Done
|
| + 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), |
|
mikecase (-- gone --)
2016/06/14 22:22:51
you probably have to pass the full path of the apk
the real yoland
2016/06/14 23:27:15
yes....the jar files are like `out/Debug/test.lib.
mikecase (-- gone --)
2016/06/14 23:43:36
Lol. I think it would be best to pass in full path
the real yoland
2016/06/15 00:45:12
Hmm, actually because the jars are stored in out/[
|
| + '--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:51
Why can't you have an --output-file-name or someth
the real yoland
2016/06/14 23:27:15
Because I want to add the script runtime IN to the
mikecase (-- gone --)
2016/06/14 23:43:36
oh, then this sounds fine to me. Might want to ren
the real yoland
2016/06/15 00:45:12
Done
|
| + '-v']) |
| + api.gsutil.upload( |
| + temp_output_dir.join('%s-android-chrome.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')) |