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

Custom Entitlement Computation: API testers #2452

Merged
merged 2 commits into from
Apr 27, 2023

Conversation

NachoSoto
Copy link
Contributor

Changes:

  • Created CustomEntitlementComputationSwiftAPITester
  • Cleaned up checks for ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION in existing API testers
  • Running new API tester in CI as part of the Custom Entitlement Computation SPM build

### Changes:
- Created `CustomEntitlementComputationSwiftAPITester`
- Cleaned up checks for `ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION` in existing API testers
- Running new API tester in CI as part of the Custom Entitlement Computation SPM build
@NachoSoto NachoSoto added the test label Apr 26, 2023
@NachoSoto NachoSoto requested a review from a team April 26, 2023 18:41
Copy link
Member

@aboedo aboedo 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, left a question regarding the attribution api

Comment on lines 13 to 14
func checkAttributionAPI() {
attribution.setAttributes([String: String]())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we shouldn't really even have this be available in this mode, might wanna hide it too. subs attributes shouldn't work

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do they work? i.e.: if you call them right now, do they actually set data?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it won't work because these are instance methods and there's no public initializer for the type, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oooh I missed this. Yeah Purchases.attribution is not exposed but I'll hide this too.
Good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this now. Hiding Attribution altogether would require a lot of code changes.
It's impossible to use this because you can't access Purchases.attribution, so I think we're good.

I'll remove this file from APITester because we don't actually care about this type in here.

@@ -179,10 +173,6 @@ + (void)checkAPI {
[p logIn:@"" completion:^(RCCustomerInfo *i, BOOL created, NSError *e) { }];
[p logOutWithCompletion:^(RCCustomerInfo *i, NSError *e) { }];

#if ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION
[p switchUserToNewAppUserID:@""];
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed we don't have API tests for ObjC for the new mode... But not sure how necessary that is.

@NachoSoto
Copy link
Contributor Author

Merging this.

@NachoSoto NachoSoto enabled auto-merge (squash) April 27, 2023 19:26
@NachoSoto NachoSoto merged commit e8ac411 into main Apr 27, 2023
@NachoSoto NachoSoto deleted the custom-entitlement-computation-api-tester branch April 27, 2023 19:50
aboedo pushed a commit that referenced this pull request Apr 27, 2023
### Changes:
- Created `CustomEntitlementComputationSwiftAPITester`
- Cleaned up checks for `ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION` in
existing API testers
- Running new API tester in CI as part of the Custom Entitlement
Computation SPM build
NachoSoto added a commit that referenced this pull request Apr 27, 2023
### Changes:
- Created `CustomEntitlementComputationSwiftAPITester`
- Cleaned up checks for `ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION` in
existing API testers
- Running new API tester in CI as part of the Custom Entitlement
Computation SPM build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants