| # Copyright 2021 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 PB.go.chromium.org.luci.buildbucket.proto import common as common_pb2 |
| |
| DEPS = [ |
| "fuchsia/autocorrelator", |
| "fuchsia/status_check", |
| ] |
| |
| |
| def RunSteps(api): |
| api.autocorrelator.check_ci( |
| "check ci", |
| builder="fuchsia/ci/foo.x64", |
| base_commit="foo", |
| build_status=common_pb2.FAILURE, |
| summary_markdown="2 tests failed", |
| ) |
| api.autocorrelator.check_try( |
| "check try", |
| builder="fuchsia/try/foo.x64", |
| change_num=123456, |
| build_status=common_pb2.FAILURE, |
| ignore_skipped_build=True, |
| ignore_skipped_tests=True, |
| summary_markdown="2 tests failed", |
| ) |
| |
| |
| def GenTests(api): |
| check_ci_test_data = { |
| "build_id": "123", |
| "score": 0.97, |
| "commit_dist": 1, |
| "is_green": False, |
| } |
| check_try_test_data = [ |
| {"build_id": "456", "score": 0.98, "is_green": False}, |
| {"build_id": "789", "score": 0.0, "is_green": True}, |
| {"build_id": "987", "score": 0.96, "is_green": False}, |
| {"build_id": "654", "score": 0.99, "is_green": False}, |
| ] |
| yield api.status_check.test("basic") + api.autocorrelator.check_ci( |
| "check ci", test_data=check_ci_test_data |
| ) + api.autocorrelator.check_try("check try", test_data=check_try_test_data) |
| |
| yield api.status_check.test("no_findings") + api.autocorrelator.check_ci( |
| "check ci", test_data=None |
| ) + api.autocorrelator.check_try("check try", test_data=None) |