xref: /aosp_15_r20/external/crosvm/infra/recipe_modules/crosvm/examples/source_context.py (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1# Copyright 2022 The ChromiumOS Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5PYTHON_VERSION_COMPATIBILITY = "PY3"
6
7DEPS = [
8    "crosvm",
9    "recipe_engine/buildbucket",
10]
11
12
13def RunSteps(api):
14    with api.crosvm.source_context():
15        api.crosvm.get_git_sha()
16
17
18def GenTests(api):
19    REPO = "https://chromium.googlesource.com/crosvm/crosvm"
20    REVISION = "2d72510e447ab60a9728aeea2362d8be2cbd7789"
21
22    yield (
23        api.test(
24            "prepare_source_for_try",
25            api.buildbucket.try_build(project="crosvm", git_repo=REPO),
26        )
27    )
28    yield (
29        api.test(
30            "prepare_source_for_ci",
31            api.buildbucket.ci_build(project="crosvm", git_repo=REPO, revision=REVISION),
32        )
33    )
34    yield (
35        api.test(
36            "repair_submodules",
37            api.buildbucket.ci_build(project="crosvm", git_repo=REPO, revision=REVISION),
38            api.step_data(
39                "Prepare source.Sync submodules.Init / Update submodules",
40                retcode=1,
41            ),
42        )
43    )
44