blob: 1632e47ab558a367b320c27eea3911fd14eed284 [file] [log] [blame]
# Copyright 2017 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
DEPS = [
"fuchsia/buildbucket_util",
"fuchsia/commit_queue",
"recipe_engine/properties",
]
PROPERTIES = {
"include_unrestricted": Property(kind=bool, default=True),
"include_restricted": Property(kind=bool, default=False),
"included_repos": Property(default=None),
}
def RunSteps(api, include_unrestricted, include_restricted, included_repos):
api.commit_queue.all_tryjobs(
include_unrestricted=include_unrestricted,
include_restricted=include_restricted,
included_repos=included_repos,
)
# Repeated call just to check caching works.
api.commit_queue.all_tryjobs(
include_unrestricted=include_unrestricted,
include_restricted=include_restricted,
included_repos=included_repos,
)
def GenTests(api):
project = "project"
yield (
api.buildbucket_util.test("basic", tryjob=True, project=project)
+ api.commit_queue.test_data(project)
)
yield (
api.buildbucket_util.test("restricted", tryjob=True, project=project)
+ api.properties(include_unrestricted=False, include_restricted=True)
+ api.commit_queue.test_data(project)
)
yield (
api.buildbucket_util.test("includable_only", tryjob=True, project=project)
+ api.commit_queue.test_data(project, "includable_only")
)
yield (
api.buildbucket_util.test("mode_allowlist", tryjob=True, project=project)
+ api.commit_queue.test_data(project, "mode_allowlist")
)
yield (
api.buildbucket_util.test("location_filters", tryjob=True, project=project)
+ api.commit_queue.test_data(project, "location_filters")
)
yield (
api.buildbucket_util.test("filtered_repos", tryjob=True, project=project)
+ api.properties(included_repos={"https://fuchsia.googlesource.com/fuchsia"})
+ api.commit_queue.test_data(project)
)