blob: ac2949c742e56dbc4c8126a8fc3621ff59070b70 [file] [log] [blame]
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine.recipe_api import Property
from RECIPE_MODULES.fuchsia.symbolize.api import SYMBOLIZER_TIMEOUT_SECS
DEPS = [
"fuchsia/symbolize",
"recipe_engine/properties",
"recipe_engine/step",
]
PROPERTIES = {
"build_id_dirs": Property(
kind=list, help="Passed through symbolizer.__call__().", default=()
),
"debug_symbol_url": Property(
kind=str, help="Passed through symbolizer.__call__().", default=None
),
}
def RunSteps(api, build_id_dirs, debug_symbol_url):
# Need to nest because symbolize requires a parent step. (The parent
# step does not need to be read in but is required nonetheless.)
with api.step.nest("nest") as presentation:
presentation.logs["symbolized log"] = api.symbolize(
symbolizer_tool="symbolizer-tool",
data="blah\nblah\n",
build_id_dirs=build_id_dirs,
debug_symbol_url=debug_symbol_url,
json_output="path/to/symbolizer-output.json",
)
def GenTests(api):
yield api.test("debug_symbol_url") + api.properties(
debug_symbol_url="gs://artifacts/debug"
)
yield api.test("build_id_dirs") + api.properties(build_id_dirs=list("abcde"))
yield (
api.test("failure", status="INFRA_FAILURE")
+ api.properties(debug_symbol_url="gs://artifacts/debug")
+ api.step_data("nest.symbolize logs", retcode=1)
)
yield (
api.test("timeout")
+ api.properties(debug_symbol_url="gs://artifacts/debug")
+ api.step_data(
"nest.symbolize logs", times_out_after=SYMBOLIZER_TIMEOUT_SECS + 1
)
)