bazel-skylib
bazel-skylib copied to clipboard
Test rule to verify aspect applied to another target
Some workflows apply a top level aspect to a build, such as:
bazel build //foo:bar --aspect=//baz:my_aspect.bzl%my_aspect
It would be nice to have a canonical test rule which would verify that builds such as these would work.
It should be as simple as creating a thin analysis test rule which applies the aspect along the edge. That is, a test rule with attribute defined:
deps' : attr.label_list(aspects = [my_aspect]),
And then, to satisfy the above example, the user could create a test target that has //foo:bar as one of its deps.