Modify skpbench to use newer adb version

Bug: skia:
NOTRY=true
Change-Id: Ib630d352b6922280ef5772e6843f8f031baeffaf
Reviewed-on: https://skia-review.googlesource.com/59161
Reviewed-by: Eric Boren <borenet@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
Kevin Lubick 2017-10-13 08:15:09 -04:00 committed by Skia Commit-Bot
parent bd27d1de7a
commit cccaef1667
8 changed files with 19 additions and 9 deletions

View File

@ -811,7 +811,7 @@ Recipe for the Skia RecreateSKPs Bot.
[DEPS](/infra/bots/recipes/skpbench.py#12): [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/file][recipe_engine/recipe_modules/file], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/python][recipe_engine/recipe_modules/python], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step], [recipe\_engine/time][recipe_engine/recipe_modules/time], [core](#recipe_modules-core), [flavor](#recipe_modules-flavor), [run](#recipe_modules-run), [vars](#recipe_modules-vars)
&mdash; **def [RunSteps](/infra/bots/recipes/skpbench.py#103)(api):**
&mdash; **def [RunSteps](/infra/bots/recipes/skpbench.py#104)(api):**
&mdash; **def [skpbench\_steps](/infra/bots/recipes/skpbench.py#41)(api):**

View File

@ -209,6 +209,8 @@
"/data/local/tmp/skpbench",
"/sdcard/revenge_of_the_skiabot/skps",
"--adb",
"--adb_binary",
"adb.1.0.35",
"--resultsfile",
"[CUSTOM_[SWARM_OUT_DIR]]/table",
"--config",

View File

@ -209,6 +209,8 @@
"/data/local/tmp/skpbench",
"/sdcard/revenge_of_the_skiabot/skps",
"--adb",
"--adb_binary",
"adb.1.0.35",
"--resultsfile",
"[CUSTOM_[SWARM_OUT_DIR]]/table",
"--config",

View File

@ -209,6 +209,8 @@
"/data/local/tmp/skpbench",
"/sdcard/revenge_of_the_skiabot/skps",
"--adb",
"--adb_binary",
"adb.1.0.35",
"--resultsfile",
"[CUSTOM_[SWARM_OUT_DIR]]/table",
"--config",

View File

@ -54,6 +54,7 @@ def skpbench_steps(api):
api.path.join(api.vars.android_bin_dir, 'skpbench'),
api.path.join(api.vars.android_data_dir, 'skps'),
'--adb',
'--adb_binary', ADB_BINARY,
'--resultsfile', table,
'--config', config,
# TODO(dogben): Track down what's causing bots to die.

View File

@ -9,8 +9,8 @@ import subprocess
import sys
class Adb:
def __init__(self, device_serial=None, echo=False):
self.__invocation = ['adb']
def __init__(self, device_serial=None, adb_binary=None, echo=False):
self.__invocation = [adb_binary]
if device_serial:
self.__invocation.extend(['-s', device_serial])
self.__echo = echo

View File

@ -9,9 +9,9 @@ import subprocess
__ADB = None
def init(device_serial):
def init(device_serial, adb_binary):
global __ADB
__ADB = Adb(device_serial)
__ADB = Adb(device_serial, adb_binary)
def join(*pathnames):
return '/'.join(pathnames)

View File

@ -61,11 +61,13 @@ __argparse.add_argument('-a', '--resultsfile',
__argparse.add_argument('skps',
nargs='+',
help=".skp files or directories to expand for .skp files")
__argparse.add_argument('--adb_binary', default='adb',
help="The name of the adb binary to use.")
FLAGS = __argparse.parse_args()
if FLAGS.adb:
import _adb_path as _path
_path.init(FLAGS.device_serial)
_path.init(FLAGS.device_serial, FLAGS.adb_binary)
else:
import _os_path as _path
@ -110,9 +112,9 @@ class SKPBench:
ARGV.extend(['--fps', 'true'])
if FLAGS.adb:
if FLAGS.device_serial is None:
ARGV[:0] = ['adb', 'shell']
ARGV[:0] = [FLAGS.adb_binary, 'shell']
else:
ARGV[:0] = ['adb', '-s', FLAGS.device_serial, 'shell']
ARGV[:0] = [FLAGS.adb_binary, '-s', FLAGS.device_serial, 'shell']
@classmethod
def get_header(cls, outfile=sys.stdout):
@ -278,7 +280,8 @@ def main():
skps = _path.find_skps(FLAGS.skps)
if FLAGS.adb:
adb = Adb(FLAGS.device_serial, echo=(FLAGS.verbosity >= 5))
adb = Adb(FLAGS.device_serial, FLAGS.adb_binary,
echo=(FLAGS.verbosity >= 5))
model = adb.check('getprop ro.product.model').strip()
if model == 'Pixel C':
from _hardware_pixel_c import HardwarePixelC