blob: 14db1ca4e11e5bf81ee14bc3409c8fd25a60e908 [file] [log] [blame]
# Copyright 2024 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/gerrit",
"fuchsia/git_checkout",
"fuchsia/roller_configurator",
"recipe_engine/buildbucket",
]
def RunSteps(api):
# Checkout triggering repository
remote, _ = api.gerrit.resolve_change(api.buildbucket.build.input.gerrit_changes[0])
triggering_repo_dir, _ = api.git_checkout(remote)
# Run roller-configurator validator to get JSON output
path_to_roller_config = triggering_repo_dir / "rollers.textproto"
api.roller_configurator.validate(path_to_roller_config)
def GenTests(api):
yield api.buildbucket_util.test(
"successful_validation",
tryjob=True,
project="fuchsia",
git_repo="https://fuchsia.googlesource.com/fuchsia",
)
yield api.buildbucket_util.test(
"unsuccessful_validation",
tryjob=True,
project="fuchsia",
git_repo="https://fuchsia.googlesource.com/fuchsia",
)