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
Allow specifying additional aspects to tut #299
Conversation
+1, without this PR or other solution to #189 I am not able to conveniently unit test aspects. My workaround is to create an artificial rule that applies the aspect on its attribute, and collects the aspect outputs, but I'm still not able to make assertions about providers provided by the aspect on targets it's attached to. I'm happy to write up a longer problem description if ^ is not clear enough. |
@tetromino - would you mind taking a quick look? Thanks! |
@brandjon @tetromino would you be able to take a look here? 😅 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but can you please add a small test to tests/unittest_tests.bzl and unittest_test.sh?
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 :))
88c3f7d
to
a4aa41d
Compare
a4aa41d
to
2363fa3
Compare
Added - thanks for the review @tetromino! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test!
To simulate this in a test I had to define a separate attribute with the
aspect applied and ignore
target_under_test
, except becausetarget_under_test
is mandatory I had to set some value for it whichwas ignored.
This may or may not fix
#189 (I could see also
wanting a
build_test
-like target which builds with an aspect - I'm notentirely sure what the scope of that issue was meant to be :))