aspect-build / rules_py

More compatible Bazel rules for running Python tools and building Python projects
Apache License 2.0
86 stars 29 forks source link

[Bug]: Tried to set properties for non-existent exec groups: test. #426

Closed blockjon-dd closed 1 month ago

blockjon-dd commented 1 month ago

What happened?

I'm trying to add this to my py_test

    exec_properties = {
        # Tell BuildBuddy to run this test using a Firecracker microVM.
        "test.workload-isolation-type": "firecracker",
        # Tell BuildBuddy to ensure that the Docker daemon is started
        # inside the microVM before the test starts, so that we don't
        # have to worry about starting it ourselves.
        "test.init-dockerd": "true",
    },

as soon as I do that, rules_py seems to error with this message:

Tried to set properties for non-existent exec groups: test.

Version

Development (host) and target OS/architectures:

Output of bazel --version: bazel 7.4.0

Version of the Aspect rules, or other relevant rules from your WORKSPACE or MODULE.bazel file: 1.0.0-rc0

Language(s) and/or frameworks involved:

How to reproduce

Create any basic test and then add exec properties. Here's what my file looks like:

load("@aspect_rules_py//py:defs.bzl", "py_library", "py_test")

py_library(
    name = "calculator",
    srcs = ["calculator.py"],
    visibility = ["//:__subpackages__"],
)

py_test(
    name = "calculator_test",
    srcs = ["calculator_test.py"],
    deps = [":calculator"],
    exec_properties = {
        # Tell BuildBuddy to run this test using a Firecracker microVM.
        "test.workload-isolation-type": "firecracker",
        # Tell BuildBuddy to ensure that the Docker daemon is started
        # inside the microVM before the test starts, so that we don't
        # have to worry about starting it ourselves.
        "test.init-dockerd": "true",
    },
)


### Any other information?

_No response_
blockjon-dd commented 1 month ago

when i try this against plain rules_python, i get the same problem so i dont think it was a bug in aspect rules_py