2022-09-13 17:55:17 +00:00
|
|
|
# Copyright 2022 The ChromiumOS Authors
|
2022-05-25 21:21:31 +00:00
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
from recipe_engine.post_process import Filter
|
|
|
|
|
|
|
|
PYTHON_VERSION_COMPATIBILITY = "PY3"
|
|
|
|
|
|
|
|
DEPS = [
|
|
|
|
"crosvm",
|
2022-08-12 22:23:39 +00:00
|
|
|
"recipe_engine/raw_io",
|
2022-05-25 21:21:31 +00:00
|
|
|
"recipe_engine/buildbucket",
|
|
|
|
"recipe_engine/context",
|
|
|
|
"recipe_engine/properties",
|
|
|
|
"recipe_engine/step",
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def RunSteps(api):
|
2022-06-22 21:13:09 +00:00
|
|
|
with api.crosvm.container_build_context():
|
2022-05-31 20:47:19 +00:00
|
|
|
api.step(
|
|
|
|
"Self-test dev-container",
|
|
|
|
[
|
|
|
|
"vpython3",
|
|
|
|
api.crosvm.source_dir.join("tools/dev_container"),
|
|
|
|
"--verbose",
|
|
|
|
"--self-test",
|
|
|
|
],
|
|
|
|
)
|
2022-08-12 22:23:39 +00:00
|
|
|
result = api.step(
|
|
|
|
"List checks to run",
|
|
|
|
[
|
|
|
|
"vpython3",
|
|
|
|
api.crosvm.source_dir.join("tools/health-check"),
|
|
|
|
"--list-checks",
|
|
|
|
],
|
|
|
|
stdout=api.raw_io.output(),
|
|
|
|
)
|
|
|
|
check_list = result.stdout.strip().decode("utf-8").split("\n")
|
|
|
|
for check in check_list:
|
|
|
|
api.crosvm.step_in_container(
|
|
|
|
"Checking %s" % check, ["./tools/health-check", "--all", check]
|
|
|
|
)
|
2022-05-25 21:21:31 +00:00
|
|
|
|
2022-08-01 22:37:13 +00:00
|
|
|
api.crosvm.step_in_container("Checking mdbook", ["mdbook", "build", "docs/book/"])
|
|
|
|
api.crosvm.step_in_container(
|
|
|
|
"Checking cargo docs",
|
|
|
|
["./tools/cargo-doc"],
|
|
|
|
)
|
|
|
|
|
2022-05-25 21:21:31 +00:00
|
|
|
|
|
|
|
def GenTests(api):
|
|
|
|
yield (
|
|
|
|
api.test(
|
|
|
|
"basic",
|
|
|
|
api.buildbucket.ci_build(project="crosvm/crosvm"),
|
2022-08-12 22:23:39 +00:00
|
|
|
# Provide a fake response to --list-checks
|
|
|
|
api.step_data(
|
|
|
|
"List checks to run",
|
|
|
|
stdout=api.raw_io.output("a\nb"),
|
|
|
|
),
|
2022-05-25 21:21:31 +00:00
|
|
|
)
|
|
|
|
+ api.post_process(Filter().include_re(r"Checking.*"))
|
|
|
|
)
|