Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test rule to verify aspect applied to another target #189

Open
c-parsons opened this issue Sep 4, 2019 · 0 comments
Open

Test rule to verify aspect applied to another target #189

c-parsons opened this issue Sep 4, 2019 · 0 comments
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) type: feature request

Comments

@c-parsons
Copy link
Collaborator

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.

illicitonion added a commit to illicitonion/bazel-skylib that referenced this issue May 24, 2021
To simulate this in a test I had to define a separate attribute with the
aspect applied and ignore `target_under_test`, except because
`target_under_test` is mandatory I had to set some value for it which
was ignored.

This may or may not fix
bazelbuild#189 (I could see also
wanting a `build_test`-like target which builds with an aspect - I'm not
entirely sure what the scope of that issue was meant to be :))
@brandjon brandjon added P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) type: feature request labels Jun 10, 2021
illicitonion added a commit to illicitonion/bazel-skylib that referenced this issue Sep 20, 2021
To simulate this in a test I had to define a separate attribute with the
aspect applied and ignore `target_under_test`, except because
`target_under_test` is mandatory I had to set some value for it which
was ignored.

This may or may not fix
bazelbuild#189 (I could see also
wanting a `build_test`-like target which builds with an aspect - I'm not
entirely sure what the scope of that issue was meant to be :))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P4 This is either out of scope or we don't have bandwidth to review a PR. (No assignee) type: feature request
Projects
None yet
Development

No branches or pull requests

2 participants