-
Notifications
You must be signed in to change notification settings - Fork 51
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 code more accurately detects dependencies #153
Merged
illicitonion
merged 7 commits into
bazel-contrib:main
from
illicitonion:foreign-testonly
Mar 2, 2023
Merged
Test code more accurately detects dependencies #153
illicitonion
merged 7 commits into
bazel-contrib:main
from
illicitonion:foreign-testonly
Mar 2, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7d475ea
to
2c4951c
Compare
2c4951c
to
51341dd
Compare
shs96c
approved these changes
Mar 2, 2023
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.
Seems fine, but I have questions. They're not serious enough to block landing the PR, though.
Before, some slices of strings contained both packages and strings, and we weren't clearly handling each correctly. Instead, be explicit about where we're using each.
Previously we were treating testonly libraries as unique packages in their own namespace. Instead, treat them as having the correct package name, but embed the "is testonly" data in a struct so we can choose to filter on it flexibly as we wish.
Previously, test targets assumed that they had matching production code they were testing, and would error if it couldn't be found. Instead, treat this as a normal occurrence, as often test code exists in its own package with no directly corresponding production code package.
This only works if there was no non-test package providing the same package. We don't automatically set the visibility for the depended-on code - this is an explicit decision that should be made by a human as to whether that dependency should be allowed.
51341dd
to
d8a746a
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In particular, two classes of dependency are now better handled:
I strongly recommend reviewing commit-by-commit.
Fixes #136