Repository: firecracker-microvm/firecracker
File: .buildkite/pipeline_pr.py (Python)

Code before:

if not pipeline.args.no_kani and (
    not changed_files
    or any(x.suffix in [".rs", ".toml", ".lock"] for x in changed_files)
    or any(x.parent.name == "devctr" for x in changed_files)
):
    kani_grp = pipeline.build_group(
        "🔍 Kani",
        "./tools/devtool -y test --no-build -- ../tests/integration_tests/test_kani.py -n auto",
        # Kani step default
        # Kani runs fastest on m6a.metal
        instances=["m6a.metal", "m7g.metal"],
        platforms=[("al2023", "linux_6.1")],
        timeout_in_minutes=300,
        **DEFAULTS_PERF,
        depends_on_build=False,
    )
    # modify Kani steps' label
    for step in kani_grp["steps"]:
        step["label"] = "🔍 Kani"

if any(x.parent.name == "hiding_ci" for x in changed_files):
    pipeline.build_group_per_arch(
        "🕵️ Build Secret Hiding Kernel",
        pipeline.devtool_test(
            pytest_opts="-m nonci integration_tests/build/test_hiding_kernel.py",
        ),
        depends_on_build=False,
    )

if run_all_tests(changed_files):
    pipeline.build_group(
        "📦 Build",
        pipeline.devtool_test(pytest_opts="integration_tests/build/"),
        depends_on_build=False,
    )

    pipeline.build_group(
        "⚙ Functional and security 🔒",
        pipeline.devtool_test(
            pytest_opts="-n 16 --dist worksteal integration_tests/{{functional,security}}",
        ),
    )

    pipeline.build_group(
        "⏱ Performance",
        pipeline.devtool_test(
            devtool_opts="--performance -c 1-10 -m 0",
            pytest_opts="../tests/integration_tests/performance/",
        ),
        **DEFAULTS_PERF,

Review comment (suggestion):
mh, I guess as long as we don't setup an nightly pipelines, reusing `nonci` is fine, but if we ever have a nightly pipeline on this branch that also passes `-m nonci`, then it might pick up this test by accident, which we don't want probably. Thought on using a dedicated pytest mark for this test? :o 

Code after:

if not pipeline.args.no_kani and (
    not changed_files
    or any(x.suffix in [".rs", ".toml", ".lock"] for x in changed_files)
    or any(x.parent.name == "devctr" for x in changed_files)
):
    kani_grp = pipeline.build_group(
        "🔍 Kani",
        "./tools/devtool -y test --no-build -- ../tests/integration_tests/test_kani.py -n auto",
        # Kani step default
        # Kani runs fastest on m6a.metal
        instances=["m6a.metal", "m7g.metal"],
        platforms=[("al2023", "linux_6.1")],
        timeout_in_minutes=300,
        **DEFAULTS_PERF,
        depends_on_build=False,
    )
    # modify Kani steps' label
    for step in kani_grp["steps"]:
        step["label"] = "🔍 Kani"

if any(x.parent.name == "hiding_ci" for x in changed_files):
    pipeline.build_group_per_arch(
        "🕵️ Build Secret Hiding Kernel",
        pipeline.devtool_test(
            pytest_opts="-m secret_hiding integration_tests/build/test_hiding_kernel.py",
        ),
        depends_on_build=False,
    )

if run_all_tests(changed_files):
    pipeline.build_group(
        "📦 Build",
        pipeline.devtool_test(pytest_opts="integration_tests/build/"),
        depends_on_build=False,
    )

    pipeline.build_group(
        "⚙ Functional and security 🔒",
        pipeline.devtool_test(
            pytest_opts="-n 16 --dist worksteal integration_tests/{{functional,security}}",
        ),
    )

    pipeline.build_group(
        "⏱ Performance",
        pipeline.devtool_test(
            devtool_opts="--performance -c 1-10 -m 0",
            pytest_opts="../tests/integration_tests/performance/",
        ),
        **DEFAULTS_PERF,