| # 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 recipe_engine.recipe_api import Property |
| |
| DEPS = [ |
| "fuchsia/gerrit_auto_submit", |
| "fuchsia/status_check", |
| "recipe_engine/properties", |
| ] |
| |
| PROPERTIES = { |
| "dry_run": Property(kind=bool, help="", default=False), |
| } |
| |
| |
| def RunSteps(api, dry_run): |
| return api.gerrit_auto_submit(dry_run=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() |
| ) |