Created ReceiptParser SPM#2155
Conversation
43171dd to
a9ae4cd
Compare
357968c to
194f350
Compare
a9ae4cd to
d356639
Compare
726312b to
5e0c5ca
Compare
There was a problem hiding this comment.
We need some files specific to just the ReceiptParser module (right now the separate LoggerType).
There was a problem hiding this comment.
Should this be ** to match within subdirectories? Just in case we ever addd directories to that folder
There was a problem hiding this comment.
This works 👍🏻 changed.
d356639 to
0ff0269
Compare
fbfec51 to
bdc4073
Compare
0ff0269 to
1b9e77a
Compare
bdc4073 to
93e6b19
Compare
| import Foundation | ||
| import ReceiptParser | ||
|
|
||
| func checkAppleReceiptAPI(_ receipt: AppleReceipt! = nil) { |
There was a problem hiding this comment.
These API tests seem kinda duplicated with the ones in the other project . I wonder if we could avoid the duplication creating a symlink or something like that? Not sure if that would work.
There was a problem hiding this comment.
Or maybe remove them from the other project?
There was a problem hiding this comment.
Here's my reasoning:
- Keeping both: we have these APIs exposed as part of
RevenueCatandReceiptParser, so we need to make sure that they're stable in each - Keeping them separate: this file is checking the API for
ReceiptParser.PurchasesReceiptParser. The other file checksRevenueCat.PurchasesReceiptParserAPI. Obviously we share code internally, but the interfaces might not always coincide.Purchases.ReceiptParsermight have more methods in the future because it's part of the bigger SDK.
There was a problem hiding this comment.
Keeping them separate: this file is checking the API for ReceiptParser. The other file checks RevenueCat's PurchasesReceiptParser API. Obviously we share code internally, but the interfaces might not always coincide. Purchases.ReceiptParser might have more methods in the future because it's part of the bigger SDK.
Hmm well, do you have in mind any possible future cases of this scenario? If we do I think it's ok but if not, I would prefer avoiding duplication now for an uncertain scenario.
There was a problem hiding this comment.
I'm not sure how to do this in a clean way though. The files might be similar but not quite. One has to import RevenueCat and the other import ReceiptParser.
There was a problem hiding this comment.
Hmm right... I didn't think about that. In that case, I think it's ok to leave as is. Don't want to have a complex setup for the sake of avoiding a bit of duplication.
There was a problem hiding this comment.
It was a good suggestion though. But yeah not sure it's worth it since we'd need to have some way of dynamically copying contents of the file, etc. etc.
|
|
||
| var body: some Scene { | ||
| WindowGroup { | ||
| EmptyView() |
There was a problem hiding this comment.
Hmm, do we need this file? I guess we need the project in order to have the tests, but not sure if the project requires an app class like this which doesn't seem useful right now.
There was a problem hiding this comment.
I made this project as slim as possible. The other integration test apps have even more stuff in them.
| import ReceiptParserIntegration | ||
| import XCTest | ||
|
|
||
| final class ReceiptParserIntegrationTests: XCTestCase { |
There was a problem hiding this comment.
Should we add a success test case here?
There was a problem hiding this comment.
I'd need to have a sample receipt in here, which are pretty large.
The actual logic for parsing receipts is already tested in unit tests. This is an installation test, so I think simply checking that the method can be called and it does what it's supposed to is enough.
|
|
||
| final class ReceiptParserIntegrationTests: XCTestCase { | ||
|
|
||
| func testCanParseReceipts() throws { |
There was a problem hiding this comment.
Maybe rename to testParsingEmptyReceiptThrowsError or something like that? In case we add more tests in the future.
vegaro
left a comment
There was a problem hiding this comment.
Looks good to me! I guess you've tried installing it locally or from this branch and it works fine 😄
1b9e77a to
05d4883
Compare
93e6b19 to
9220755
Compare
Finishes [CSDK-17]. - Created target in `Package.swift` - Created `ReceiptParser` target in project - Added CI `spm-receipt-parser` job - Added CI `installation-tests-receipt-parser` job - Added `ReceiptParser` scheme to allow building the target from Xcode - Added `ReceiptParserAPITester` to test API for `ReceiptParser`'s target - Compile `ReceiptParserAPITester` when running `RevenueCat` tests so these are validated as well.
9220755 to
1aae13d
Compare
**This is an automatic release.** ### New Features * Created `ReceiptParser` SPM (#2155) via NachoSoto (@NachoSoto) * Exposed `PurchasesReceiptParser` and `AppleReceipt` (#2153) via NachoSoto (@NachoSoto) ### Bugfixes * `Restore purchases`: post product data when posting receipts (#2178) via NachoSoto (@NachoSoto) ### Other Changes * Added `Dictionary.merge` (#2190) via NachoSoto (@NachoSoto) * `CircleCI`: use Xcode 14.2.0 (#2187) via NachoSoto (@NachoSoto) * `ReceiptParser`: a few documentation improvements (#2189) via NachoSoto (@NachoSoto) * `Purchase Tester`: fixed `TestFlight` deployment (#2188) via NachoSoto (@NachoSoto) * `Purchase Tester`: display specific `IntroEligibilityStatus` (#2184) via NachoSoto (@NachoSoto) * `Purchase Tester`: fixed `SubscriptionPeriod` (#2185) via NachoSoto (@NachoSoto)

Finishes CSDK-17.
Follow up to #2153. Extracted from #2096.
Changes:
Package.swift. It can be built separately:swift build --target ReceiptParserReceiptParsertarget in project:ReceiptParserscheme to allow building the target from Xcode:spm-receipt-parserjobinstallation-tests-receipt-parserjobReceiptParserAPITesterto test API forReceiptParser's targetReceiptParserAPITesterwhen runningRevenueCattests so these are validated as well. -