[recipes] Fix *_VERSION step failure handling
Bug: skia:6473 Change-Id: I2fa6f800f59f40f74b5c080c52cdec3a32329ef7 NOTRY=true Reviewed-on: https://skia-review.googlesource.com/14240 Commit-Queue: Stephan Altmueller <stephana@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com> Reviewed-by: Stephan Altmueller <stephana@google.com>
This commit is contained in:
parent
a28e2b07b7
commit
bb05f70b4b
@ -108,8 +108,8 @@ class SkiaFlavorApi(recipe_api.RecipeApi):
|
||||
def create_clean_device_dir(self, path):
|
||||
return self._f.create_clean_device_dir(path)
|
||||
|
||||
def read_file_on_device(self, path):
|
||||
return self._f.read_file_on_device(path)
|
||||
def read_file_on_device(self, path, **kwargs):
|
||||
return self._f.read_file_on_device(path, **kwargs)
|
||||
|
||||
def remove_file_on_device(self, path):
|
||||
return self._f.remove_file_on_device(path)
|
||||
@ -145,9 +145,10 @@ class SkiaFlavorApi(recipe_api.RecipeApi):
|
||||
device_version_file = self.device_path_join(
|
||||
self.device_dirs.tmp_dir, version_file)
|
||||
if str(actual_version_file) != str(device_version_file):
|
||||
try:
|
||||
device_version = self.read_file_on_device(device_version_file)
|
||||
except self.m.step.StepFailure:
|
||||
device_version = self.read_file_on_device(device_version_file,
|
||||
abort_on_failure=False,
|
||||
fail_build_on_failure=False)
|
||||
if not device_version:
|
||||
device_version = VERSION_NONE
|
||||
if device_version != host_version:
|
||||
self.remove_file_on_device(device_version_file)
|
||||
|
@ -303,26 +303,6 @@
|
||||
"infra_step": true,
|
||||
"name": "write SKP_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
"-oConnectTimeout=15",
|
||||
"-oBatchMode=yes",
|
||||
"-t",
|
||||
"-t",
|
||||
"foo@127.0.0.1",
|
||||
"touch",
|
||||
"/home/chronos/user/SKP_VERSION"
|
||||
],
|
||||
"env": {
|
||||
"BUILDTYPE": "Release",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "touch /home/chronos/user/SKP_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
@ -469,26 +449,6 @@
|
||||
"infra_step": true,
|
||||
"name": "write SK_IMAGE_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
"-oConnectTimeout=15",
|
||||
"-oBatchMode=yes",
|
||||
"-t",
|
||||
"-t",
|
||||
"foo@127.0.0.1",
|
||||
"touch",
|
||||
"/home/chronos/user/SK_IMAGE_VERSION"
|
||||
],
|
||||
"env": {
|
||||
"BUILDTYPE": "Release",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "touch /home/chronos/user/SK_IMAGE_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
@ -635,26 +595,6 @@
|
||||
"infra_step": true,
|
||||
"name": "write SVG_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
"-oConnectTimeout=15",
|
||||
"-oBatchMode=yes",
|
||||
"-t",
|
||||
"-t",
|
||||
"foo@127.0.0.1",
|
||||
"touch",
|
||||
"/home/chronos/user/SVG_VERSION"
|
||||
],
|
||||
"env": {
|
||||
"BUILDTYPE": "Release",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "touch /home/chronos/user/SVG_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
|
@ -848,23 +848,6 @@
|
||||
"@@@STEP_LOG_END@python.inline@@@"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"adb",
|
||||
"shell",
|
||||
"reboot",
|
||||
"-p"
|
||||
],
|
||||
"cwd": "[START_DIR]/skia",
|
||||
"env": {
|
||||
"BUILDTYPE": "Debug",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "shut down device to quarantine bot"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"adb",
|
||||
@ -882,8 +865,7 @@
|
||||
},
|
||||
{
|
||||
"name": "$result",
|
||||
"reason": "Failed build steps: read /sdcard/revenge_of_the_skiabot/SK_IMAGE_VERSION",
|
||||
"recipe_result": null,
|
||||
"status_code": 1
|
||||
"status_code": 0
|
||||
}
|
||||
]
|
@ -218,9 +218,11 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
|
||||
def copy_directory_contents_to_host(self, device, host):
|
||||
self._adb('pull %s %s' % (device, host), 'pull', device, host)
|
||||
|
||||
def read_file_on_device(self, path):
|
||||
return self._adb('read %s' % path,
|
||||
'shell', 'cat', path, stdout=self.m.raw_io.output()).stdout
|
||||
def read_file_on_device(self, path, **kwargs):
|
||||
rv = self._adb('read %s' % path,
|
||||
'shell', 'cat', path, stdout=self.m.raw_io.output(),
|
||||
**kwargs)
|
||||
return rv.stdout.rstrip() if rv and rv.stdout else None
|
||||
|
||||
def remove_file_on_device(self, path):
|
||||
self._adb('rm %s' % path, 'shell', 'rm', '-f', path)
|
||||
|
@ -151,11 +151,11 @@ class GNChromebookFlavorUtils(gn_flavor.GNFlavorUtils):
|
||||
self._ssh('rm %s' % path, 'rm', '-rf', path)
|
||||
self._ssh('mkdir %s' % path, 'mkdir', '-p', path)
|
||||
|
||||
def read_file_on_device(self, path):
|
||||
# To avoid failure if file doesn't exist.
|
||||
self._ssh('touch %s' % path, 'touch', path)
|
||||
return self._ssh('read %s' % path,
|
||||
'cat', path, stdout=self.m.raw_io.output()).stdout
|
||||
def read_file_on_device(self, path, **kwargs):
|
||||
rv = self._ssh('read %s' % path,
|
||||
'cat', path, stdout=self.m.raw_io.output(),
|
||||
**kwargs)
|
||||
return rv.stdout.rstrip() if rv and rv.stdout else None
|
||||
|
||||
def remove_file_on_device(self, path):
|
||||
# use -f to silently return if path doesn't exist
|
||||
|
@ -65,11 +65,12 @@ class iOSFlavorUtils(gn_flavor.GNFlavorUtils):
|
||||
self._run_ios_script('rm', path)
|
||||
self._run_ios_script('mkdir', path)
|
||||
|
||||
def read_file_on_device(self, path):
|
||||
def read_file_on_device(self, path, **kwargs):
|
||||
full = self.m.vars.skia_dir.join('platform_tools/ios/bin/ios_cat_file')
|
||||
rc = self.m.run(self.m.step,
|
||||
rv = self.m.run(self.m.step,
|
||||
name = 'cat_file %s' % path,
|
||||
cmd = [full, path],
|
||||
stdout=self.m.raw_io.output(),
|
||||
infra_step=kInfraStep)
|
||||
return rc.stdout.rstrip() if rc.stdout else rc.stdout
|
||||
infra_step=kInfraStep,
|
||||
**kwargs)
|
||||
return rv.stdout.rstrip() if rv and rv.stdout else None
|
||||
|
@ -152,26 +152,6 @@
|
||||
"infra_step": true,
|
||||
"name": "write SKP_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
"-oConnectTimeout=15",
|
||||
"-oBatchMode=yes",
|
||||
"-t",
|
||||
"-t",
|
||||
"foo@127.0.0.1",
|
||||
"touch",
|
||||
"/home/chronos/user/SKP_VERSION"
|
||||
],
|
||||
"env": {
|
||||
"BUILDTYPE": "Release",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "touch /home/chronos/user/SKP_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
@ -318,26 +298,6 @@
|
||||
"infra_step": true,
|
||||
"name": "write SK_IMAGE_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
"-oConnectTimeout=15",
|
||||
"-oBatchMode=yes",
|
||||
"-t",
|
||||
"-t",
|
||||
"foo@127.0.0.1",
|
||||
"touch",
|
||||
"/home/chronos/user/SK_IMAGE_VERSION"
|
||||
],
|
||||
"env": {
|
||||
"BUILDTYPE": "Release",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "touch /home/chronos/user/SK_IMAGE_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
@ -484,26 +444,6 @@
|
||||
"infra_step": true,
|
||||
"name": "write SVG_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
"-oConnectTimeout=15",
|
||||
"-oBatchMode=yes",
|
||||
"-t",
|
||||
"-t",
|
||||
"foo@127.0.0.1",
|
||||
"touch",
|
||||
"/home/chronos/user/SVG_VERSION"
|
||||
],
|
||||
"env": {
|
||||
"BUILDTYPE": "Release",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "touch /home/chronos/user/SVG_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
|
@ -152,26 +152,6 @@
|
||||
"infra_step": true,
|
||||
"name": "write SKP_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
"-oConnectTimeout=15",
|
||||
"-oBatchMode=yes",
|
||||
"-t",
|
||||
"-t",
|
||||
"foo@127.0.0.1",
|
||||
"touch",
|
||||
"/home/chronos/user/SKP_VERSION"
|
||||
],
|
||||
"env": {
|
||||
"BUILDTYPE": "Debug",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "touch /home/chronos/user/SKP_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
@ -318,26 +298,6 @@
|
||||
"infra_step": true,
|
||||
"name": "write SK_IMAGE_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
"-oConnectTimeout=15",
|
||||
"-oBatchMode=yes",
|
||||
"-t",
|
||||
"-t",
|
||||
"foo@127.0.0.1",
|
||||
"touch",
|
||||
"/home/chronos/user/SK_IMAGE_VERSION"
|
||||
],
|
||||
"env": {
|
||||
"BUILDTYPE": "Debug",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "touch /home/chronos/user/SK_IMAGE_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
@ -484,26 +444,6 @@
|
||||
"infra_step": true,
|
||||
"name": "write SVG_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
"-oConnectTimeout=15",
|
||||
"-oBatchMode=yes",
|
||||
"-t",
|
||||
"-t",
|
||||
"foo@127.0.0.1",
|
||||
"touch",
|
||||
"/home/chronos/user/SVG_VERSION"
|
||||
],
|
||||
"env": {
|
||||
"BUILDTYPE": "Debug",
|
||||
"CHROME_HEADLESS": "1",
|
||||
"PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]",
|
||||
"SKIA_OUT": "[START_DIR]/out"
|
||||
},
|
||||
"infra_step": true,
|
||||
"name": "touch /home/chronos/user/SVG_VERSION"
|
||||
},
|
||||
{
|
||||
"cmd": [
|
||||
"ssh",
|
||||
|
Loading…
Reference in New Issue
Block a user