blob: 3dc2c92e89cb421a21889b06e80f5282acaac8c5 [file] [log] [blame]
# Copyright 2020 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.
DEPS = [
"fuchsia/buildbucket_util",
"fuchsia/kythe",
"fuchsia/status_check",
"recipe_engine/buildbucket",
"recipe_engine/file",
"recipe_engine/path",
]
def RunSteps(api):
# api.kythe.kythe_dir needs to be both set and not set for coverage to be
# complete, and this was easy.
if api.buildbucket_util.is_tryjob:
api.kythe.kythe_dir = api.path["start_dir"].join("kythe")
api.kythe.kythe_libs_dir = api.path["start_dir"].join("kythe-libs")
api.kythe.extract_and_upload(
checkout_dir=api.path["start_dir"].join("checkout"),
build_dir=api.path["start_dir"].join("build"),
corpus="corpus",
gcs_bucket="bucket",
gcs_filename="filename",
)
def GenTests(api):
yield (
api.status_check.test("try") + api.buildbucket.try_build() + api.kythe.valid()
)
yield (
api.status_check.test("kzips")
+ api.step_data("glob kzips", api.file.glob_paths(["foo.kzip", "bar.kzip"]))
+ api.kythe.valid()
)
yield api.status_check.test("validation_no_output", status="failure")
yield (
api.status_check.test("validation_failure", status="failure")
+ api.kythe.invalid()
)