-
Notifications
You must be signed in to change notification settings - Fork 94
Pass product module name into test_rule #627
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
Conversation
rules/test.bzl
Outdated
| tests.append(test_name) | ||
| split_rule( | ||
| name = test_name, | ||
| product_module_name = name.replace("-", "_"), |
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.
Should this use kwargs.module_name?
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.
Yes! I thought this was a thing but I couldn't find it initially
d508a8b to
c155dd3
Compare
|
Have we solved additions to |
3f04150 to
8eddfd0
Compare
rules/test.bzl
Outdated
| tests.append(test_name) | ||
| split_rule( | ||
| name = test_name, | ||
| module_name = kwargs["module_name"], |
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.
Would adding "module_name" to _IOS_TEST_KWARGS accomplish the same thing while keeping all the important keys in one place?
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.
Yeah it should. Tried it at first but it failed for a way i didn't understand and din't have to time to debug. I actually didn't mean to push this up but was int he wrong repo :). I need to debug why it wasn't working and hopefully get it to work
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.
So this wasn't able to be done because the kwargs["module_name"] was also used in apple_library our current implementation of _IOS_TEST_KWARGS pops them off so they aren't passed into apple_library. I added a comment explaining in code so it's not as confusing int he future
@mattrobmattrob I was thinking of looking into some patching for this PR as well but i'm not sure how future-proof that is |
8eddfd0 to
fb01225
Compare
fb01225 to
3fdaa96
Compare
|
@mattrobmattrob @jerrymarino PTAL at how I plan on doing patching. LMK if there is something else we may want to do |
jerrymarino
left a comment
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.
Filtering looks fine - my main comment is on maintaining patch files for rules_apple bumps.. Do you have PRs linked for that? We can take the other approach for a subset of rules_apple if they aren't upstreamable.
|
Also are there concerns the rules_apple patch will break for people even with landing this? I gave it a stamp assuming we'll fix it - but it might cause an issue. |
➕ to @mattrobmattrob comment on this |
|
|
||
| rule( | ||
| name = name, | ||
| module_name = module_name, |
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.
I think this will break other people that have a different version of rules_apple ( similar of @mattrobmattrob's comment )
|
We already keep a fork of This said - we'll still need to make it backwards compatible. |
|
FWIW, I don't want to block a merge because of backwards compatibility, necessarily. Just want it to be a conversation. 👍 We are essentially on trunk so it shouldn't cause any issues for us. |
|
The "backwards compatibility" issue I encountered was the PR seemed to require me to use the rules_apple version generated by the patch: in other words, if it needs argument |
|
@dostrander if you want to add an if statement in a macro - I came up with a mechansim to add this: We might want this anyhow - but let me know what you're thoughts are. I added some suggestions to simplify rules_apple in that review BTW - both which can be backwards compatible. |
|
Declining this as I've made a better fix in rules_apple itself. May need to open up a new PR to use that and xctesturnner fixes |
This will need to wait until this is merged