Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Side by Side Diff: scripts/slave/recipe_modules/chromium_android/api.py

Issue 2192563004: [Android] Move host_info from test config to recipe step for android perf bots. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: [Android] Move host_info from test config to recipe step for android perf bots. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | scripts/slave/recipes/android/perf.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import contextlib 5 import contextlib
6 import datetime 6 import datetime
7 import json 7 import json
8 import os 8 import os
9 import re 9 import re
10 import sys 10 import sys
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 'file format is compatible') 363 'file format is compatible')
364 364
365 def device_status_check(self, restart_usb=False, **kwargs): 365 def device_status_check(self, restart_usb=False, **kwargs):
366 # TODO(bpastene): Remove once chromium revisions prior to 366 # TODO(bpastene): Remove once chromium revisions prior to
367 # crrev.com/1faecde0c03013b6cd725da413339c60223f8948 are no longer tested. 367 # crrev.com/1faecde0c03013b6cd725da413339c60223f8948 are no longer tested.
368 # See crbug.com/619707 for context. 368 # See crbug.com/619707 for context.
369 self.revert_device_file_format() 369 self.revert_device_file_format()
370 self.device_recovery() 370 self.device_recovery()
371 return self.device_status() 371 return self.device_status()
372 372
373 def host_info(self, args=[], **kwargs):
374 try:
375 with self.handle_exit_codes():
376 args.extend(['run', '--output', self.m.json.output()])
377 self.m.step(
378 'Host_Info',
379 [self.m.path['checkout'].join('testing', 'scripts',
380 'host_info.py')] + args,
381 env=self.m.chromium.get_env(),
382 infra_step=True,
383 step_test_data=lambda: self.m.json.test_api.output({
384 'valid': True,
385 'failures': [],
386 '_host_info': {
387 'os_system': 'os_system',
388 'os_release': 'os_release',
389 'processor': 'processor',
390 'num_cpus': 'num_cpus',
391 'free_disk_space': 'free_disk_space',
392 'python_version': 'python_version',
393 'python_path': 'python_path',
394 'devices': [{
395 "usb_status": True,
396 "blacklisted": None,
397 "ro.build.fingerprint": "fingerprint",
398 "battery": {
399 "status": "5",
400 "scale": "100",
401 "temperature": "240",
402 "level": "100",
403 "technology": "Li-ion",
404 "AC powered": "false",
405 "health": "2",
406 "voltage": "4302",
407 "Wireless powered": "false",
408 "USB powered": "true",
409 "Max charging current": "500000",
410 "present": "true"
411 },
412 "adb_status": "device",
413 "imei_slice": "",
414 "ro.build.product": "bullhead",
415 "ro.build.id": "MDB08Q",
416 "serial": "00d0d567893340f4",
417 "wifi_ip": ""
418 }]
419 }}),
420 **kwargs)
421 except self.m.step.InfraFailure:
422 pass
423
373 def device_recovery(self, restart_usb=False, **kwargs): 424 def device_recovery(self, restart_usb=False, **kwargs):
374 args = [ 425 args = [
375 '--blacklist-file', self.blacklist_file, 426 '--blacklist-file', self.blacklist_file,
376 '--known-devices-file', self.known_devices_file, 427 '--known-devices-file', self.known_devices_file,
377 '--adb-path', self.m.adb.adb_path(), 428 '--adb-path', self.m.adb.adb_path(),
378 '-v' 429 '-v'
379 ] 430 ]
380 self.m.step( 431 self.m.step(
381 'device_recovery', 432 'device_recovery',
382 [self.m.path['checkout'].join('third_party', 'catapult', 'devil', 433 [self.m.path['checkout'].join('third_party', 'catapult', 'devil',
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 script = self.c.test_runner 1460 script = self.c.test_runner
1410 if wrapper_script_suite_name: 1461 if wrapper_script_suite_name:
1411 script = self.m.chromium.output_dir.join('bin', 'run_%s' % 1462 script = self.m.chromium.output_dir.join('bin', 'run_%s' %
1412 wrapper_script_suite_name) 1463 wrapper_script_suite_name)
1413 else: 1464 else:
1414 env = kwargs.get('env', {}) 1465 env = kwargs.get('env', {})
1415 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR', 1466 env['CHROMIUM_OUTPUT_DIR'] = env.get('CHROMIUM_OUTPUT_DIR',
1416 self.m.chromium.output_dir) 1467 self.m.chromium.output_dir)
1417 kwargs['env'] = env 1468 kwargs['env'] = env
1418 return self.m.python(step_name, script, args, **kwargs) 1469 return self.m.python(step_name, script, args, **kwargs)
OLDNEW
« no previous file with comments | « no previous file | scripts/slave/recipes/android/perf.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698