| # Copyright 2019 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. |
| |
| import base64 |
| |
| from recipe_engine import recipe_test_api |
| |
| DEFAULT_COMMIT_QUEUE_CFGS = { |
| 'default': |
| """ |
| submit_options: < |
| max_burst: 4 |
| burst_delay: < |
| seconds: 480 |
| > |
| > |
| |
| config_groups: < |
| gerrit: < |
| url: "https://fuchsia-review.googlesource.com" |
| projects: < |
| name: "cobalt" |
| ref_regexp: "refs/heads/.+" |
| > |
| > |
| |
| verifiers: < |
| gerrit_cq_ability: < |
| committer_list: "project-fuchsia-committers" |
| dry_run_access_list: "project-fuchsia-tryjob-access" |
| > |
| tryjob: < |
| builders: < |
| name: "fuchsia/try/cobalt-x64-linux" |
| location_regexp: ".*" |
| location_regexp_exclude: ".+/[+]/.*\\.md" |
| > |
| > |
| > |
| > |
| |
| config_groups: < |
| gerrit: < |
| url: "https://fuchsia-review.googlesource.com" |
| projects: < |
| name: "docs" |
| ref_regexp: "refs/heads/.+" |
| > |
| > |
| |
| verifiers: < |
| gerrit_cq_ability: < |
| committer_list: "project-fuchsia-committers" |
| dry_run_access_list: "project-fuchsia-tryjob-access" |
| > |
| tryjob: < |
| builders: < |
| name: "fuchsia/try/doc-checker" |
| experiment_percentage: 100 |
| location_regexp: ".*" |
| location_regexp_exclude: ".+/[+]/.*\\.md" |
| > |
| > |
| > |
| > |
| |
| config_groups: < |
| gerrit: < |
| url: "https://fuchsia-review.googlesource.com" |
| projects: < |
| name: "experiences" |
| ref_regexp: "refs/heads/.+" |
| > |
| > |
| verifiers: < |
| gerrit_cq_ability: < |
| committer_list: "project-fuchsia-committers" |
| dry_run_access_list: "project-fuchsia-tryjob-access" |
| > |
| tree_status: < |
| url: "https://fuchsia-stem-status.appspot.com" |
| > |
| |
| tryjob: < |
| builders: < |
| name: "fuchsia/try/fuchsia-arm64-debug" |
| location_regexp: ".*" |
| location_regexp_exclude: ".+/[+]/.*\\.md" |
| location_regexp_exclude: ".+/[+].*/docs/.+" |
| > |
| builders: < |
| name: "fuchsia/try/fuchsia-x64-debug" |
| location_regexp: ".*" |
| location_regexp_exclude: ".+/[+]/.*\\.md" |
| location_regexp_exclude: ".+/[+].*/docs/.+" |
| > |
| > |
| > |
| > |
| """, |
| 'recipes-only': |
| """ |
| submit_options: < |
| max_burst: 4 |
| burst_delay: < |
| seconds: 480 |
| > |
| > |
| |
| config_groups: < |
| gerrit: < |
| url: "https://fuchsia-review.googlesource.com" |
| projects: < |
| name: "cobalt" |
| ref_regexp: "refs/heads/.+" |
| > |
| > |
| |
| verifiers: < |
| gerrit_cq_ability: < |
| committer_list: "project-fuchsia-committers" |
| dry_run_access_list: "project-fuchsia-tryjob-access" |
| > |
| tryjob: < |
| builders: < |
| name: "fuchsia/try/recipes" |
| location_regexp: ".*" |
| location_regexp_exclude: ".+/[+]/.*\\.md" |
| > |
| > |
| > |
| > |
| """, |
| 'only-fuchsia-debug': |
| """ |
| submit_options: < |
| max_burst: 4 |
| burst_delay: < |
| seconds: 480 |
| > |
| > |
| |
| config_groups: < |
| gerrit: < |
| url: "https://fuchsia-review.googlesource.com" |
| projects: < |
| name: "experiences" |
| ref_regexp: "refs/heads/.+" |
| > |
| > |
| verifiers: < |
| gerrit_cq_ability: < |
| committer_list: "project-fuchsia-committers" |
| dry_run_access_list: "project-fuchsia-tryjob-access" |
| > |
| tree_status: < |
| url: "https://fuchsia-stem-status.appspot.com" |
| > |
| |
| tryjob: < |
| builders: < |
| name: "fuchsia/try/fuchsia-arm64-debug" |
| location_regexp: ".*" |
| location_regexp_exclude: ".+/[+]/.*\\.md" |
| location_regexp_exclude: ".+/[+].*/docs/.+" |
| > |
| builders: < |
| name: "fuchsia/try/fuchsia-x64-debug" |
| location_regexp: ".*" |
| location_regexp_exclude: ".+/[+]/.*\\.md" |
| location_regexp_exclude: ".+/[+].*/docs/.+" |
| > |
| > |
| > |
| > |
| """, |
| 'empty': |
| """ |
| submit_options: < |
| max_burst: 4 |
| burst_delay: < |
| seconds: 480 |
| > |
| > |
| |
| config_groups: < |
| gerrit: < |
| url: "https://fuchsia-review.googlesource.com" |
| projects: < |
| name: "experiences" |
| ref_regexp: "refs/heads/.+" |
| > |
| > |
| verifiers: < |
| gerrit_cq_ability: < |
| committer_list: "project-fuchsia-committers" |
| dry_run_access_list: "project-fuchsia-tryjob-access" |
| > |
| tree_status: < |
| url: "https://fuchsia-stem-status.appspot.com" |
| > |
| > |
| > |
| """, |
| } |
| |
| |
| class CommitQueueTestApi(recipe_test_api.RecipeTestApi): |
| |
| def test_data(self, data='default', step_name='get commit-queue.get'): |
| if data in DEFAULT_COMMIT_QUEUE_CFGS: |
| data = DEFAULT_COMMIT_QUEUE_CFGS[data] |
| |
| return self.m.url.json(step_name, dict(content=base64.b64encode(data))) |