blob: f43b80d196d042ecf45772409e25037741882658 [file] [log] [blame]
# Copyright 2021 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.
"""A helper recipe for integration-testing the recipe_bootstrap tool.
Expected to be invoked locally as a luciexe sub-build by the parent.py
recipe. See parent.py for details.
"""
from PB.go.chromium.org.luci.buildbucket.proto import common as common_pb2
from PB.recipe_engine.result import RawResult
from PB.recipes.fuchsia.recipe_bootstrap_test.child import InputProperties
DEPS = [
"fuchsia/status_check",
"recipe_engine/properties",
"recipe_engine/step",
]
PROPERTIES = InputProperties
def RunSteps(api, props):
if not props.recipe_bootstrap_enabled:
return RawResult(
summary_markdown="checks failed: recipe_bootstrap didn't forward "
"the expected properties",
status=common_pb2.FAILURE,
)
step = api.step.empty("recipe_bootstrap passed all checks")
# The parent recipe will check that this property is set.
step.presentation.properties["output_property"] = "arbitrary-value"
def GenTests(api):
yield (
api.status_check.test("basic") + api.properties(recipe_bootstrap_enabled=True)
)
yield api.status_check.test("properties_missing", status="failure")