| # 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), |
| } |
| |
| |
| def RunSteps(api, include_unrestricted, include_restricted): |
| api.commit_queue.all_tryjobs( |
| include_unrestricted=include_unrestricted, include_restricted=include_restricted |
| ) |
| |
| # Repeated call just to check caching works. |
| api.commit_queue.all_tryjobs( |
| include_unrestricted=include_unrestricted, include_restricted=include_restricted |
| ) |
| |
| |
| 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") |
| ) |