blob: 514ae777285af1023c95a71d4ac2d06f75a04ca7 [file] [log] [blame]
# 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.
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"
}
builders: {
name: "fuchsia/try/secret-tryjob"
location_regexp: ".*"
location_regexp_exclude: ".+/[+]/.*\\.md"
result_visibility: COMMENT_LEVEL_RESTRICTED
}
}
}
}
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/.+"
}
}
}
}
""",
"includable_only": """
submit_options: {
max_burst: 4
burst_delay: {
seconds: 480
}
}
config_groups: {
gerrit: {
url: "https:xx//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"
includable_only: true
}
}
}
}
""",
"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"):
if data in DEFAULT_COMMIT_QUEUE_CFGS:
data = DEFAULT_COMMIT_QUEUE_CFGS[data]
return self.m.luci_config.mock_config("commit-queue.cfg", data)