# Copyright 2022 The ChromiumOS Authors
# 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",
    "recipe_engine/buildbucket",
    "recipe_engine/context",
    "recipe_engine/properties",
    "recipe_engine/step",
]


def RunSteps(api):
    # Note: The recipe does work on linux as well, if the required dependencies have been installed
    # on the host via ./tools/install-deps.
    # This allows the build to be tested via `./recipe.py run build_windows`
    with api.crosvm.host_build_context():
        api.step(
            "Build crosvm tests",
            [
                "vpython3",
                "./tools/run_tests",
                "--verbose",
                "--build-only",
            ],
        )
        api.step(
            "Run crosvm tests",
            [
                "vpython3",
                "./tools/run_tests",
                "--verbose",
            ],
        )


def GenTests(api):
    filter_steps = Filter("Build crosvm tests", "Run crosvm tests")
    yield (
        api.test(
            "build",
            api.buildbucket.ci_build(project="crosvm/crosvm"),
        )
        + api.post_process(filter_steps)
    )

# Copyright 2022 The ChromiumOS Authors
# 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",
    "recipe_engine/buildbucket",
    "recipe_engine/context",
    "recipe_engine/properties",
    "recipe_engine/step",
]


def RunSteps(api):
    # Note: The recipe does work on linux as well, if the required dependencies have been installed
    # on the host via ./tools/install-deps.
    # This allows the build to be tested via `./recipe.py run build_windows`
    with api.crosvm.host_build_context():
        api.step(
            "Build crosvm tests",
            [
                "vpython3",
                "./tools/run_tests",
                "--verbose",
                "--build-only",
            ],
        )
        api.step(
            "Run crosvm tests",
            [
                "vpython3",
                "./tools/run_tests",
                "--verbose",
            ],
        )
        api.step(
            "Clippy windows crosvm",
            [
                "vpython3",
                "./tools/clippy",
            ],
        )


def GenTests(api):
    filter_steps = Filter("Build crosvm tests", "Run crosvm tests")
    yield (
        api.test(
            "build",
            api.buildbucket.ci_build(project="crosvm/crosvm"),
        )
        + api.post_process(filter_steps)
    )

Enable clippy in windows LUCI
crosvm: Enable clippy in windows LUCI

For linux based systems, clippy continues to run in health_check

BUG=b:257249038
TEST=CQ

Change-Id: I39d3d45a0db72c61e79fd2c51b195b82c067a244
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3993934
Reviewed-by: Dennis Kempin <cd09796fb571bec2782819dbfd33307f65b1c778@google.com>
Commit-Queue: Vikram Auradkar <50abc1d85bedfd527fc7dee23f4819d1f0d946ec@google.com>
