Skip to content

BasePurchasesTests: consolidate to only initialize one DeviceCache#2863

Merged
NachoSoto merged 1 commit into
mainfrom
purchases-tests-device-cache
Jul 24, 2023
Merged

BasePurchasesTests: consolidate to only initialize one DeviceCache#2863
NachoSoto merged 1 commit into
mainfrom
purchases-tests-device-cache

Conversation

@NachoSoto

Copy link
Copy Markdown
Contributor

I moved the Purchases.logLevel change to the beginning of the test too, which makes this more obvious: every test was creating 2 instances of MockDeviceCache.

This also required setting MockCachingTrialOrIntroPriceEligibilityChecker to nil because that was making IdentityManager leak, and therefore one of the 2 MockDeviceCaches leak!

I moved the `Purchases.logLevel` change to the beginning of the test too, which makes this more obvious: every test was creating 2 instances of `MockDeviceCache`.
This also required setting `MockCachingTrialOrIntroPriceEligibilityChecker` to `nil` because that was making `IdentityManager` leak, and therefore one of the 2 `MockDeviceCache`s leak!
@NachoSoto NachoSoto added the test label Jul 24, 2023
@NachoSoto NachoSoto requested a review from a team July 24, 2023 09:24
@NachoSoto NachoSoto enabled auto-merge (squash) July 24, 2023 11:30
@codecov

codecov Bot commented Jul 24, 2023

Copy link
Copy Markdown

Codecov Report

Merging #2863 (50bc18e) into main (5ce59d7) will increase coverage by 0.10%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2863      +/-   ##
==========================================
+ Coverage   86.48%   86.58%   +0.10%     
==========================================
  Files         217      217              
  Lines       15513    15513              
==========================================
+ Hits        13416    13432      +16     
+ Misses       2097     2081      -16     

see 5 files with indirect coverage changes

@NachoSoto NachoSoto merged commit b38f7b1 into main Jul 24, 2023
@NachoSoto NachoSoto deleted the purchases-tests-device-cache branch July 24, 2023 11:39
NachoSoto added a commit that referenced this pull request Jul 26, 2023
**This is an automatic release.**

_This release is compatible with Xcode 15 beta 5 and visionOS beta 2_

### Bugfixes
* `xrOS`: fixed `SubscriptionStoreView` for visionOS beta 2 (#2884) via
Josh Holtz (@joshdholtz)
### Performance Improvements
* `Perf`: update `CustomerInfo` cache before anything else (#2865) via
NachoSoto (@NachoSoto)
### Other Changes
* `SimpleApp`: added support for localization (#2880) via NachoSoto
(@NachoSoto)
* `TestStoreProduct`: made available on release builds (#2861) via
NachoSoto (@NachoSoto)
* `Tests`: increased default logger capacity (#2870) via NachoSoto
(@NachoSoto)
* `CustomEntitlementComputation`: removed `invalidateCustomerInfoCache`
(#2866) via NachoSoto (@NachoSoto)
* `SimpleApp`: updates for TestFlight compatibility (#2862) via
NachoSoto (@NachoSoto)
* `BasePurchasesTests`: consolidate to only initialize one `DeviceCache`
(#2863) via NachoSoto (@NachoSoto)
* `Codable`: debug log entire JSON when decoding fails (#2864) via
NachoSoto (@NachoSoto)
* `IntegrationTests`: replaced `Purchases.shared` with a `throw`ing
property (#2867) via NachoSoto (@NachoSoto)
* `NetworkError`: 2 new tests to ensure underlying error is included in
description (#2843) via NachoSoto (@NachoSoto)
* Add SPM `Package.resolved` for Xcode Cloud (#2844) via NachoSoto
(@NachoSoto)
* `CustomEntitlementComputation`: added integration test for
cancellations (#2849) via NachoSoto (@NachoSoto)
* `CustomEntitlementComputation`: removed
`syncPurchases`/`restorePurchases` (#2854) via NachoSoto (@NachoSoto)

---------

Co-authored-by: NachoSoto <ignaciosoto90@gmail.com>
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.

2 participants