merge run and check-rc steps

This'll make the 'dm' or 'nanobench' step go red like you'd hope.

The N5 should pass and the N10 and N7 should fail, showing us both sides.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2339713003

Review-Url: https://codereview.chromium.org/2339713003
This commit is contained in:
mtklein 2016-09-14 11:15:54 -07:00 committed by Commit bot
parent 7bbda991af
commit 7de2d40dcc
2 changed files with 35 additions and 31 deletions

View File

@ -37,7 +37,7 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
def _adb(self, title, *cmd, **kwargs):
self._ever_ran_adb = True
# The only non-infra adb call (check rc) happens to not use _adb().
# The only non-infra adb steps (dm / nanobench) happen to not use _adb().
if 'infra_step' not in kwargs:
kwargs['infra_step'] = True
return self._run(title, 'adb', *cmd, **kwargs)
@ -78,6 +78,7 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
def cleanup_steps(self):
if self._ever_ran_adb:
self._adb('dump log', 'logcat', '-d')
self._adb('reboot', 'reboot')
self._adb('kill adb server', 'kill-server')
@ -94,15 +95,19 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
'push', self.m.vars.tmp_dir.join(sh), _bin_dir)
self._adb('clear log', 'logcat', '-c')
self._adb(cmd[0], 'shell', 'sh', _bin_dir + sh)
self._adb('dump log ', 'logcat', '-d')
self.m.python.inline('check %s rc' % cmd[0], """
self.m.python.inline('%s' % cmd[0], """
import subprocess
import sys
sys.exit(int(subprocess.check_output(['adb', 'shell', 'cat',
'%src'])))
""" % _bin_dir)
bin_dir = sys.argv[1]
sh = sys.argv[2]
subprocess.check_call(['adb', 'shell', 'sh', bin_dir + sh])
try:
sys.exit(int(subprocess.check_output(['adb', 'shell', 'cat',
bin_dir + 'rc'])))
except ValueError:
print "Couldn't read the return code. Probably killed for OOM."
sys.exit(1)
""", args=[_bin_dir, sh])
def copy_file_to_device(self, host, device):
self._adb('push %s %s' % (host, device), 'push', host, device)

View File

@ -528,38 +528,28 @@
"cwd": "[SLAVE_BUILD]/skia",
"name": "clear log"
},
{
"cmd": [
"adb",
"shell",
"sh",
"/data/local/tmp/dm.sh"
],
"cwd": "[SLAVE_BUILD]/skia",
"name": "dm"
},
{
"cmd": [
"adb",
"logcat",
"-d"
],
"cwd": "[SLAVE_BUILD]/skia",
"name": "dump log "
},
{
"cmd": [
"python",
"-u",
"\nimport subprocess\nimport sys\nsys.exit(int(subprocess.check_output(['adb', 'shell', 'cat',\n '/data/local/tmp/rc'])))\n"
"\nimport subprocess\nimport sys\nbin_dir = sys.argv[1]\nsh = sys.argv[2]\nsubprocess.check_call(['adb', 'shell', 'sh', bin_dir + sh])\ntry:\n sys.exit(int(subprocess.check_output(['adb', 'shell', 'cat',\n bin_dir + 'rc'])))\nexcept ValueError:\n print \"Couldn't read the return code. Probably killed for OOM.\"\n sys.exit(1)\n",
"/data/local/tmp/",
"dm.sh"
],
"name": "check dm rc",
"name": "dm",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@import subprocess@@@",
"@@@STEP_LOG_LINE@python.inline@import sys@@@",
"@@@STEP_LOG_LINE@python.inline@sys.exit(int(subprocess.check_output(['adb', 'shell', 'cat',@@@",
"@@@STEP_LOG_LINE@python.inline@ '/data/local/tmp/rc'])))@@@",
"@@@STEP_LOG_LINE@python.inline@bin_dir = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@sh = sys.argv[2]@@@",
"@@@STEP_LOG_LINE@python.inline@subprocess.check_call(['adb', 'shell', 'sh', bin_dir + sh])@@@",
"@@@STEP_LOG_LINE@python.inline@try:@@@",
"@@@STEP_LOG_LINE@python.inline@ sys.exit(int(subprocess.check_output(['adb', 'shell', 'cat',@@@",
"@@@STEP_LOG_LINE@python.inline@ bin_dir + 'rc'])))@@@",
"@@@STEP_LOG_LINE@python.inline@except ValueError:@@@",
"@@@STEP_LOG_LINE@python.inline@ print \"Couldn't read the return code. Probably killed for OOM.\"@@@",
"@@@STEP_LOG_LINE@python.inline@ sys.exit(1)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
@ -573,6 +563,15 @@
"cwd": "[SLAVE_BUILD]/skia",
"name": "pull /sdcard/revenge_of_the_skiabot/dm_out [CUSTOM_[SWARM_OUT_DIR]]/dm"
},
{
"cmd": [
"adb",
"logcat",
"-d"
],
"cwd": "[SLAVE_BUILD]/skia",
"name": "dump log"
},
{
"cmd": [
"adb",