Skip to content

Integration Tests: actually verify that entitlement is active#1880

Merged
NachoSoto merged 3 commits into
mainfrom
integration-tests-active-entitlement
Sep 9, 2022
Merged

Integration Tests: actually verify that entitlement is active#1880
NachoSoto merged 3 commits into
mainfrom
integration-tests-active-entitlement

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

verifyEntitlementWentThrough was only looking for an entitlement inside of EntitlementInfos.all, but not verifying that it's active.

@NachoSoto NachoSoto added the test label Aug 31, 2022
@NachoSoto NachoSoto requested review from a team and vegaro August 31, 2022 22:28
@NachoSoto

Copy link
Copy Markdown
Contributor Author

This is failing, I wonder if it's the same issue we've been discussing.

@NachoSoto

NachoSoto commented Sep 6, 2022

Copy link
Copy Markdown
Contributor Author

This makes TRIAGE-82 even more reproducible.

`verifyEntitlementWentThrough` was only looking for an entitlement inside of `EntitlementInfos.all`, but not verifying that it's active.
@NachoSoto NachoSoto force-pushed the integration-tests-active-entitlement branch from bc9b7a9 to f7a1451 Compare September 9, 2022 18:33
@NachoSoto NachoSoto merged commit 87065db into main Sep 9, 2022
@NachoSoto NachoSoto deleted the integration-tests-active-entitlement branch September 9, 2022 18:41
NachoSoto added a commit that referenced this pull request Sep 9, 2022
…test

Follow up to #1880. The duplicated and unnecessary `verifyEntitlementWentThrough` (that's already done by `purchaseWeeklyOffering`) didn't pass the new `verifyEntitlementIsActive`, which lead to false negatives due to the short expiration rate in weekly subscriptions.
NachoSoto added a commit that referenced this pull request Sep 12, 2022
…test (#1899)

Follow up to #1880. The duplicated and unnecessary
`verifyEntitlementWentThrough` (that's already done by
`purchaseWeeklyOffering`) didn't pass the new
`verifyEntitlementIsActive`, which lead to false negatives due to the
short expiration rate in weekly subscriptions.
NachoSoto pushed a commit that referenced this pull request Sep 23, 2022
**This is an automatic release.**

### Bugfixes
* `Purchases.beginRefundRequest`: ensured errors are `PublicError`
(#1913) via NachoSoto (@NachoSoto)
* `PurchaseTesterSwiftUI`: fixed macOS target (#1915) via NachoSoto
(@NachoSoto)
### Other Changes
* `SnapshotTesting`: require version 1.9.0 to keep supporting iOS 12/13
tests (#1931) via NachoSoto (@NachoSoto)
* Fixed `tvOS` tests (#1928) via NachoSoto (@NachoSoto)
* `pre-commit` hook: also verify leftover API keys in `PurchaseTester`
(#1914) via NachoSoto (@NachoSoto)
* `CircleCI`: changed iOS 12/13 to use Xcode 13 (#1918) via NachoSoto
(@NachoSoto)
* `PurchaseTesterSwiftUI`: removed unnecessary `UIApplicationDelegate`
(#1916) via NachoSoto (@NachoSoto)
* `CircleCI`: changed all jobs to use Xcode 14 (#1909) via NachoSoto
(@NachoSoto)
* `Atomic`: added unit test to verify `value`'s setter (#1905) via
NachoSoto (@NachoSoto)
* `spm build` CI job: changed to release build (#1903) via NachoSoto
(@NachoSoto)
* `StoreKitUnitTests`: compile on iOS 11.0+ (#1904) via NachoSoto
(@NachoSoto)
* `Purchases`: only expose testing data on `DEBUG` (#1902) via NachoSoto
(@NachoSoto)
* `Integration Tests`: added test to verify re-subscription behavior
(#1898) via NachoSoto (@NachoSoto)
* `IntegrationTests`: simplified `testExpireSubscription` to fix flaky
test (#1899) via NachoSoto (@NachoSoto)
* `Integration Tests`: actually verify that entitlement is active
(#1880) via NachoSoto (@NachoSoto)
NachoSoto added a commit that referenced this pull request Sep 28, 2022
…xpires` to fix flakiness

Fixes [CSDK-479].

### Changes:
- Removed extra `verifyEntitlementWentThrough`. #1880 introduced a change so that weekly subscriptions aren't verified, because they expire within a second. This make the test flaky due to that race condition.
- Removed `assertNoActiveSubscription`: I tried calling `SKTestSession.disableAutoRenewForTransaction`, but sometimes the server still thinks the subscription has auto-renewed. This was making the test flaky. Turns out that even if it's not active, the eligibility test still passes as expected.
NachoSoto added a commit that referenced this pull request Sep 29, 2022
…xpires` to fix flakiness (#1952)

Fixes [CSDK-479].

### Changes:
- Removed extra `verifyEntitlementWentThrough`. #1880 introduced a
change so that weekly subscriptions aren't verified, because they expire
within a second. This make the test flaky due to that race condition.
- Removed `assertNoActiveSubscription`: I tried calling
`SKTestSession.disableAutoRenewForTransaction`, but sometimes the server
still thinks the subscription has auto-renewed. This was making the test
flaky. Turns out that even if it's not active, the eligibility test
still passes as expected.
- Removed call to `syncPurchases`. It doesn't matter what state the
server is in, as long as locally `SKTestSession` has an expired
subscription.

This, together with #1945, should fix the last of the issues causing
flaky integration tests 🤞🏻

[CSDK-479]:
https://revenuecats.atlassian.net/browse/CSDK-479?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
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