Index: scripts/slave/recipes/android/perf.py |
diff --git a/scripts/slave/recipes/android/perf.py b/scripts/slave/recipes/android/perf.py |
index 63a5eec3b6e916fd3c14072633925bc20190c541..efab04be142da1d44edcd8fd3efc8c9f53c0dd4b 100644 |
--- a/scripts/slave/recipes/android/perf.py |
+++ b/scripts/slave/recipes/android/perf.py |
@@ -2,18 +2,20 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-from infra.libs.infra_types import freeze |
+from infra.libs.infra_types import freeze, thaw |
DEPS = [ |
'adb', |
'bot_update', |
'chromium', |
'chromium_android', |
+ 'chromium_tests', |
'gclient', |
'json', |
'step', |
'path', |
'properties', |
+ 'python', |
] |
REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' |
@@ -26,6 +28,10 @@ BUILDERS = freeze({ |
'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
api.properties['parent_revision']), |
'num_device_shards': 8, |
+ 'testing': { |
+ 'platform': 'linux', |
+ 'test_spec_file': 'chromium.perf.json', |
Paweł Hajdan Jr.
2015/01/30 21:20:30
This should not be under testing. It's "testing th
shatch
2015/02/09 21:23:59
Done.
|
+ }, |
}, |
'Android Nexus5 Perf': { |
'perf_id': 'android-nexus5', |
@@ -33,6 +39,10 @@ BUILDERS = freeze({ |
'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
api.properties['parent_revision']), |
'num_device_shards': 8, |
+ 'testing': { |
+ 'platform': 'linux', |
+ 'test_spec_file': 'chromium.perf.json', |
+ }, |
}, |
'Android Nexus7v2 Perf': { |
'perf_id': 'android-nexus7v2', |
@@ -40,6 +50,10 @@ BUILDERS = freeze({ |
'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
api.properties['parent_revision']), |
'num_device_shards': 8, |
+ 'testing': { |
+ 'platform': 'linux', |
+ 'test_spec_file': 'chromium.perf.json', |
+ }, |
}, |
'Android Nexus10 Perf': { |
'perf_id': 'android-nexus10', |
@@ -47,6 +61,10 @@ BUILDERS = freeze({ |
'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
api.properties['parent_revision']), |
'num_device_shards': 8, |
+ 'testing': { |
+ 'platform': 'linux', |
+ 'test_spec_file': 'chromium.perf.json', |
+ }, |
}, |
'Android MotoE Perf': { |
'perf_id': 'android-motoe', |
@@ -54,6 +72,10 @@ BUILDERS = freeze({ |
'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
api.properties['parent_revision']), |
'num_device_shards': 8, |
+ 'testing': { |
+ 'platform': 'linux', |
+ 'test_spec_file': 'chromium.perf.json', |
+ }, |
}, |
}, |
'chromium.perf.fyi': { |
@@ -87,7 +109,7 @@ BUILDERS = freeze({ |
def GenSteps(api): |
mastername = api.properties['mastername'] |
buildername = api.properties['buildername'] |
- builder = BUILDERS[mastername][buildername] |
+ builder = thaw(BUILDERS[mastername][buildername]) |
api.chromium_android.configure_from_properties('base_config', |
REPO_NAME='src', |
REPO_URL=REPO_URL, |
@@ -113,6 +135,29 @@ def GenSteps(api): |
api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev |
api.bot_update.ensure_checkout() |
+ |
+ test_spec_file = builder.get('testing', {}).get('test_spec_file', |
+ '%s.json' % mastername) |
+ test_spec_path = api.path['checkout'].join('testing', 'buildbot', |
+ test_spec_file) |
+ test_spec_result = api.json.read( |
+ 'read test spec', |
+ test_spec_path, |
+ step_test_data=lambda: api.json.test_api.output({})) |
+ test_spec_result.presentation.step_text = 'path: %s' % test_spec_path |
+ test_spec = test_spec_result.json.output |
+ |
+ scripts_compile_targets = \ |
+ api.chromium.get_compile_targets_for_scripts().json.output |
+ |
+ for generator in [api.chromium.steps.generate_script]: |
+ builder.setdefault('tests', []) |
+ builder['tests'] = ( |
+ list(generator(api, mastername, buildername, test_spec, |
+ enable_swarming=False, |
+ scripts_compile_targets=scripts_compile_targets)) + |
+ builder['tests']) |
+ |
api.path['checkout'] = api.path['slave_build'].join('src') |
api.chromium_android.clean_local_files() |
@@ -125,17 +170,20 @@ def GenSteps(api): |
'ChromeShell.apk', |
'org.chromium.chrome.shell') |
+ test_runner = api.chromium_tests.create_test_runner( |
+ api, builder.get('tests', [])) |
+ |
perf_tests = api.chromium.list_perf_tests( |
browser='android-chrome-shell', |
num_shards=builder['num_device_shards'], |
devices=api.chromium_android.devices[0:1]).json.output |
- |
try: |
+ if test_runner: |
+ test_runner() |
api.chromium_android.run_sharded_perf_tests( |
config=api.json.input(data=perf_tests), |
perf_id=builder['perf_id'], |
chartjson_file=True) |
- |
finally: |
api.chromium_android.common_tests_final_steps() |