| # Copyright 2020 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. |
| """Recipe for triggering CQ+2 on changes which meet submitability criteria and have opted in via Auto-Submit+1.""" |
| |
| from PB.recipes.fuchsia.gerrit_auto_submit import InputProperties |
| |
| PYTHON_VERSION_COMPATIBILITY = "PY3" |
| |
| DEPS = [ |
| "fuchsia/gerrit_auto_submit", |
| "fuchsia/status_check", |
| "recipe_engine/properties", |
| ] |
| |
| PROPERTIES = InputProperties |
| |
| |
| def RunSteps(api, props): |
| return api.gerrit_auto_submit(dry_run=props.dry_run) |
| |
| |
| def GenTests(api): |
| yield ( |
| api.status_check.test("default") |
| + api.properties(**api.gerrit_auto_submit.properties()) |
| + api.gerrit_auto_submit.changes_query_test_data() |
| + api.gerrit_auto_submit.changes_submitted_together_test_data() |
| + api.gerrit_auto_submit.mergeable_test_data() |
| + api.gerrit_auto_submit.cq_success() |
| ) |