Skip to content

Commit

Permalink
Fix swarming gpu profiling validation
Browse files Browse the repository at this point in the history
The recent refactoring of Swarming scripts to enforce the use of the
same ADB everywhere (google#754)
overlooked the gpu profiling validation script, this change fixes it.

Bug: b/184810080
Test: manual on a local device
  • Loading branch information
hevrard committed Apr 8, 2021
1 parent b76c39b commit 164d28d
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions test/swarming/bot-scripts/validate_gpu_profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,40 @@

def main():
parser = argparse.ArgumentParser()
parser.add_argument('adb_path', help='Path to adb command')
parser.add_argument('agi_dir', help='Path to AGI build')
parser.add_argument('out_dir', help='Path to output directory')
args = parser.parse_args()

#### Early checks and sanitization
assert os.path.isfile(args.adb_path)
adb_path = os.path.abspath(args.adb_path)
assert os.path.isdir(args.agi_dir)
agi_dir = os.path.normpath(args.agi_dir)
agi_dir = os.path.abspath(args.agi_dir)
assert os.path.isdir(args.out_dir)
out_dir = os.path.normpath(args.out_dir)
out_dir = os.path.abspath(args.out_dir)
gapit_path = os.path.join(agi_dir, 'gapit')

#### Create BotUtil with relevant adb and gapit paths
bu = botutil.BotUtil(adb_path)
bu.set_gapit_path(gapit_path)

#### Load test parameters
test_params = {}
# Do not require 'apk' and 'package' params, as some drivers are just
# obtained by system update.
botutil.load_params(test_params)

#### Install APK
#### Install APK if need be
if 'apk' in test_params.keys():
if not 'package' in test_params.keys():
botutil.log('Error: have "apk" but no "package" in params.json')
return 1
botutil.install_apk(test_params)
bu.install_apk(test_params)

#### Call gapit command
gapit = os.path.join(agi_dir, 'gapit')
cmd = [
gapit, 'validate_gpu_profiling',
'-os', 'android'
]
p = botutil.runcmd(cmd)
gapit_args = ['-os', 'android']
p = bu.gapit('validate_gpu_profiling', gapit_args)
return p.returncode


Expand Down

0 comments on commit 164d28d

Please sign in to comment.