blob: cbb6e2e19d469aeb8a3b4d7eac59d97146612e4f [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_wrapper 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_wrapper_test.child import InputProperties
DEPS = [
"recipe_engine/properties",
"recipe_engine/step",
]
PROPERTIES = InputProperties
def RunSteps(api, props):
if not props.recipe_wrapper_enabled:
return RawResult(
summary_markdown="checks failed: recipe_wrapper didn't forward "
"the expected properties",
status=common_pb2.FAILURE,
)
step = api.step.empty("recipe_wrapper 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.test("basic") + api.properties(recipe_wrapper_enabled=True)
yield api.test("properties_missing", status="FAILURE")