Conversation
This is a follow up to #717. In order to be able to reproduce #2338, which seems to be an issue only on `watchOS`, it's important that we now run tests on `watchOS` as well. ## Changes: - Added CircleCI job - Added lane - Simplified `UnitTestsHostApp` definition using `SwiftUI` - Increased _test only_ watchOS deployment target to 7.0 (this was necessary to be able to have a comm on `@main` for the host app - Fixed test compilation on `watchOS` - Disabled `HTTPClient` tests on `watchOS` (see AliSoftware/OHHTTPStubs#287) - `StoreKitConfigTestCase` is only available from `watchOS 7.0` since that's when `SKTestSession` was introduced - Added `watchOS` support to `UnitTests` target - Added `watchOS` support to `ReceiptParserTests` target - Fixed `isFamilySharable` `watchOS` version checks for version 8.0 - Created new `CI-RevenueCat` Test Plan to only run unit tests and not StoreKit tests on `watchOS`
watchOS testswatchOS
Codecov Report
@@ Coverage Diff @@
## main #2340 +/- ##
==========================================
+ Coverage 86.45% 86.52% +0.07%
==========================================
Files 189 189
Lines 12793 12793
==========================================
+ Hits 11060 11069 +9
+ Misses 1733 1724 -9 see 4 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
This was referenced Mar 16, 2023
87b3191 to
191c44e
Compare
aboedo
approved these changes
Mar 16, 2023
| import XCTest | ||
|
|
||
| @available(iOS 14.0, tvOS 14.0, macOS 11.0, watchOS 6.2, *) | ||
| @available(iOS 14.0, tvOS 14.0, macOS 11.0, watchOS 7.0, *) |
Member
There was a problem hiding this comment.
oh, SKTestSession is watchOS 7+, I'm surprised this even worked before
Contributor
Author
There was a problem hiding this comment.
We never compiled this on watchOS.
Comment on lines
+30
to
+33
| #if os(watchOS) | ||
| // See https://github.com/AliSoftware/OHHTTPStubs/issues/287 | ||
| try XCTSkipIf(true, "OHHTTPStubs does not currently support watchOS") | ||
| #endif |
Member
There was a problem hiding this comment.
would love to replace OHHTTPStubs altogether some day
9a11b07 to
8e22116
Compare
watchOSCI: also run tests on watchOS
NachoSoto
added a commit
that referenced
this pull request
Mar 16, 2023
…` crashes (#2342) Fixes #2338, [SDKONCALL-237], [SDK-2974]. `Int` is actually 32 bits in 32-bit platforms, like `watchOS` still is (sort of). This fixes 2 potential `Int` overflows: `Date.millisecondsSince1970` and `DispatchTimeInterval` arithmetic using `nanoseconds`. See also #2340. [SDKONCALL-237]: https://revenuecats.atlassian.net/browse/SDKONCALL-237?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
NachoSoto
added a commit
that referenced
this pull request
Mar 16, 2023
This is a follow up to #717. In order to be able to reproduce #2338, which seems to be an issue only on `watchOS`, it's important that we now run tests on `watchOS` as well. We probably won't be able to fully replicate that issue since we don't run tests on actual devices, so they'll still run on 64 bits. But this way we might be able to prevent issues that are only reproducible on `watchOS` in the future. - Added CircleCI job - Added lane - Simplified `UnitTestsHostApp` definition using `SwiftUI` - Increased _test only_ `watchOS` deployment target to 7.0 (this was necessary to be able to have a common `@main` for the host app) - Increased _test only_ `tvOS` deployment target to `14.0` (same as above, plus we only run tvOS tests on the latest version anyway. We test backwards compatibility through iOS already) - Fixed test compilation on `watchOS` - Disabled `HTTPClient` tests on `watchOS` (see AliSoftware/OHHTTPStubs#287) - `StoreKitConfigTestCase` is only available from `watchOS 7.0` since that's when `SKTestSession` was introduced - Added `watchOS` support to `UnitTests` target - Added `watchOS` support to `ReceiptParserTests` target - Fixed `isFamilySharable` `watchOS` version checks for version 8.0 - Created new `CI-RevenueCat` Test Plan to only run unit tests and not StoreKit tests on `watchOS`
NachoSoto
added a commit
that referenced
this pull request
Mar 16, 2023
…` crashes (#2342) Fixes #2338, [SDKONCALL-237], [SDK-2974]. `Int` is actually 32 bits in 32-bit platforms, like `watchOS` still is (sort of). This fixes 2 potential `Int` overflows: `Date.millisecondsSince1970` and `DispatchTimeInterval` arithmetic using `nanoseconds`. See also #2340. [SDKONCALL-237]: https://revenuecats.atlassian.net/browse/SDKONCALL-237?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow up to #717.
In order to be able to reproduce #2338, which seems to be an issue only on
watchOS, it's important that we now run tests onwatchOSas well.We probably won't be able to fully replicate that issue since we don't run tests on actual devices, so they'll still run on 64 bits. But this way we might be able to prevent issues that are only reproducible on
watchOSin the future.Changes:
UnitTestsHostAppdefinition usingSwiftUIwatchOSdeployment target to 7.0 (this was necessary to be able to have a common@mainfor the host app)tvOSdeployment target to14.0(same as above, plus we only run tvOS tests on the latest version anyway. We test backwards compatibility through iOS already)watchOSHTTPClienttests onwatchOS(see OHHTTPStubs not working with watchOS AliSoftware/OHHTTPStubs#287)StoreKitConfigTestCaseis only available fromwatchOS 7.0since that's whenSKTestSessionwas introducedwatchOSsupport toUnitTeststargetwatchOSsupport toReceiptParserTeststargetisFamilySharablewatchOSversion checks for version 8.0CI-RevenueCatTest Plan to only run unit tests and not StoreKit tests onwatchOS