Skip to content

Commit

Permalink
infra: Use new health check script
Browse files Browse the repository at this point in the history
The updated recipe will use --list-checks to iterate a list of
checks to run. Each check will be run separately and create a separate
luci step.

BUG=239255137
TEST=led get-builder luci.crosvm.try:health_check
  | led edit-recipe-bundle
  | led edit-cr-cl https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3830246
  | led launch

https://ci.chromium.org/swarming/task/5cacfaf0ecf10010

Change-Id: Ia67bfa8a2da9ec337174a6a9e686c72f43e84ebf
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3830246
Tested-by: Dennis Kempin <[email protected]>
Reviewed-by: Daniel Verkamp <[email protected]>
Commit-Queue: Dennis Kempin <[email protected]>
  • Loading branch information
denniskempin authored and crosvm LUCI committed Aug 15, 2022
1 parent 92f804e commit a2b14f7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 60 deletions.
4 changes: 2 additions & 2 deletions infra/README.recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ PYTHON_VERSION_COMPATIBILITY: PY3
&mdash; **def [RunSteps](/infra/recipe_modules/crosvm/examples/source_context.py#13)(api):**
### *recipes* / [health\_check](/infra/recipes/health_check.py)

[DEPS](/infra/recipes/health_check.py#9): [crosvm](#recipe_modules-crosvm), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/step][recipe_engine/recipe_modules/step]
[DEPS](/infra/recipes/health_check.py#9): [crosvm](#recipe_modules-crosvm), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/properties][recipe_engine/recipe_modules/properties], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step]

PYTHON_VERSION_COMPATIBILITY: PY3

&mdash; **def [RunSteps](/infra/recipes/health_check.py#18)(api):**
&mdash; **def [RunSteps](/infra/recipes/health_check.py#19)(api):**
### *recipes* / [push\_to\_github](/infra/recipes/push_to_github.py)

[DEPS](/infra/recipes/push_to_github.py#9): [crosvm](#recipe_modules-crosvm), [recipe\_engine/buildbucket][recipe_engine/recipe_modules/buildbucket], [recipe\_engine/context][recipe_engine/recipe_modules/context], [recipe\_engine/file][recipe_engine/recipe_modules/file], [recipe\_engine/path][recipe_engine/recipe_modules/path], [recipe\_engine/raw\_io][recipe_engine/recipe_modules/raw_io], [recipe\_engine/step][recipe_engine/recipe_modules/step]
Expand Down
60 changes: 4 additions & 56 deletions infra/recipes/health_check.expected/basic.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"[CACHE]/builder/crosvm/tools/dev_container",
"--verbose",
"./tools/health-check",
"python"
"a"
],
"cwd": "[CACHE]/builder/crosvm",
"env": {
Expand All @@ -23,15 +23,15 @@
"hostname": "rdbhost"
}
},
"name": "Checking python"
"name": "Checking a"
},
{
"cmd": [
"vpython3",
"[CACHE]/builder/crosvm/tools/dev_container",
"--verbose",
"./tools/health-check",
"misc"
"b"
],
"cwd": "[CACHE]/builder/crosvm",
"env": {
Expand All @@ -49,59 +49,7 @@
"hostname": "rdbhost"
}
},
"name": "Checking misc"
},
{
"cmd": [
"vpython3",
"[CACHE]/builder/crosvm/tools/dev_container",
"--verbose",
"./tools/health-check",
"fmt"
],
"cwd": "[CACHE]/builder/crosvm",
"env": {
"CROSVM_CONTAINER_CACHE": "[CACHE]/builder/dev_container"
},
"luci_context": {
"realm": {
"name": "crosvm/crosvm:ci"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "Checking fmt"
},
{
"cmd": [
"vpython3",
"[CACHE]/builder/crosvm/tools/dev_container",
"--verbose",
"./tools/health-check",
"clippy"
],
"cwd": "[CACHE]/builder/crosvm",
"env": {
"CROSVM_CONTAINER_CACHE": "[CACHE]/builder/dev_container"
},
"luci_context": {
"realm": {
"name": "crosvm/crosvm:ci"
},
"resultdb": {
"current_invocation": {
"name": "invocations/build:8945511751514863184",
"update_token": "token"
},
"hostname": "rdbhost"
}
},
"name": "Checking clippy"
"name": "Checking b"
},
{
"cmd": [
Expand Down
23 changes: 21 additions & 2 deletions infra/recipes/health_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

DEPS = [
"crosvm",
"recipe_engine/raw_io",
"recipe_engine/buildbucket",
"recipe_engine/context",
"recipe_engine/properties",
Expand All @@ -26,9 +27,22 @@ def RunSteps(api):
"--self-test",
],
)
for check in ("python", "misc", "fmt", "clippy"):
api.crosvm.step_in_container("Checking %s" % check, ["./tools/health-check", check])
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]
)

# TODO: Move these into health-check
api.crosvm.step_in_container("Checking mdbook", ["mdbook", "build", "docs/book/"])
api.crosvm.step_in_container(
"Checking cargo docs",
Expand All @@ -41,6 +55,11 @@ def GenTests(api):
api.test(
"basic",
api.buildbucket.ci_build(project="crosvm/crosvm"),
# Provide a fake response to --list-checks
api.step_data(
"List checks to run",
stdout=api.raw_io.output("a\nb"),
),
)
+ api.post_process(Filter().include_re(r"Checking.*"))
)

0 comments on commit a2b14f7

Please sign in to comment.