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

Allow specifying additional aspects to tut #299

Merged
merged 2 commits into from Sep 23, 2021

Conversation

illicitonion
Copy link
Contributor

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
#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 :))

@hlopko
Copy link
Member

hlopko commented May 27, 2021

+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.

@illicitonion
Copy link
Contributor Author

@tetromino - would you mind taking a quick look? Thanks!

@UebelAndre
Copy link
Contributor

@brandjon @tetromino would you be able to take a look here? 😅 🙏

Copy link
Collaborator

@tetromino tetromino left a 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 :))
@illicitonion illicitonion force-pushed the extra_tut_aspects branch 2 times, most recently from 88c3f7d to a4aa41d Compare September 20, 2021 14:50
@illicitonion
Copy link
Contributor Author

Added - thanks for the review @tetromino!

Copy link
Collaborator

@tetromino tetromino left a 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!

@tetromino tetromino merged commit 08398cd into bazelbuild:main Sep 23, 2021
@UebelAndre UebelAndre mentioned this pull request Sep 23, 2021
@illicitonion illicitonion deleted the extra_tut_aspects branch October 11, 2021 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants