bazel-skylib icon indicating copy to clipboard operation
bazel-skylib copied to clipboard

Test rule to verify aspect applied to another target

Open c-parsons opened this issue 6 years ago • 0 comments

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.

c-parsons avatar Sep 04 '19 17:09 c-parsons