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

Observation #200

Merged
merged 65 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c8ded4e
Bump
stephencelis Dec 7, 2023
bf0c97a
wip
stephencelis Dec 7, 2023
84fb895
wip
stephencelis Dec 7, 2023
7a12f8b
wip
stephencelis Dec 8, 2023
e67c0c9
wip
stephencelis Dec 8, 2023
5b24ecf
wip
stephencelis Dec 8, 2023
015932b
wip
stephencelis Dec 8, 2023
57d676d
wip
stephencelis Dec 8, 2023
816d53f
wip
stephencelis Dec 8, 2023
286618f
wip
stephencelis Dec 8, 2023
49df034
wip
stephencelis Dec 8, 2023
0c5270b
wip
stephencelis Dec 8, 2023
852d16c
wip
stephencelis Dec 8, 2023
39c9bb7
wip
stephencelis Dec 8, 2023
19c35f6
wip
stephencelis Dec 8, 2023
fda7be3
wip
stephencelis Dec 8, 2023
3e5a8aa
wip
stephencelis Dec 8, 2023
810fcf3
wip
stephencelis Dec 8, 2023
0932033
wip
stephencelis Dec 8, 2023
4db019c
wip
stephencelis Dec 8, 2023
7b9ae18
wip
stephencelis Dec 8, 2023
70b7e3b
wip
stephencelis Dec 8, 2023
d7da8fc
wip
stephencelis Dec 8, 2023
27e4812
wip
stephencelis Dec 8, 2023
efa9f2b
wip
stephencelis Dec 8, 2023
716bf9c
wip
stephencelis Dec 8, 2023
0aaa62e
wip
stephencelis Dec 8, 2023
7e009ff
wip
stephencelis Dec 8, 2023
de50bc5
wip
stephencelis Dec 8, 2023
319387e
wip
stephencelis Dec 8, 2023
c2f288f
wip
stephencelis Dec 8, 2023
be08617
wip
stephencelis Dec 8, 2023
8abe58f
wip
stephencelis Dec 8, 2023
4a1b154
Merge remote-tracking branch 'origin/main' into observation-beta
stephencelis Dec 8, 2023
f59b3de
wip
stephencelis Dec 8, 2023
e57166f
wip
stephencelis Dec 9, 2023
8a8ff1f
wip
stephencelis Dec 9, 2023
a34be6f
wip
stephencelis Dec 9, 2023
380ce12
wip
stephencelis Dec 9, 2023
eb75020
wip
stephencelis Dec 9, 2023
2fc8dc6
wip
stephencelis Dec 9, 2023
5233f32
wip
stephencelis Dec 9, 2023
cf5f10e
wip
stephencelis Dec 9, 2023
eab3475
wip
stephencelis Dec 9, 2023
2a30738
wip
stephencelis Dec 9, 2023
0740836
wip
stephencelis Dec 9, 2023
db145d3
wip
stephencelis Dec 9, 2023
fa6251d
wip
stephencelis Dec 9, 2023
fd47050
wip
stephencelis Dec 9, 2023
29fae99
Merge branch 'main' into observation-beta
stephencelis Jan 10, 2024
7199286
wip
stephencelis Jan 10, 2024
bc41412
wip
stephencelis Jan 25, 2024
cee0c1c
Merge remote-tracking branch 'origin/main' into observation-beta
stephencelis Jan 25, 2024
098df9f
wip
stephencelis Jan 25, 2024
03716cf
wip
stephencelis Jan 25, 2024
d39632d
Remove firstLaunchOnboarding (#198)
imjn Jan 25, 2024
07e5628
Merge remote-tracking branch 'origin/main' into observation-beta
mbrandonw Apr 7, 2024
beeda8f
use enum reducers
mbrandonw Apr 7, 2024
29d1884
fix some warnings
mbrandonw Apr 7, 2024
b93b94c
udpate last destination reducer
mbrandonw Apr 8, 2024
b9d6bed
ignore some errors
mbrandonw Apr 8, 2024
dae32ea
wip
mbrandonw Apr 9, 2024
ba30ab2
wip
stephencelis Apr 9, 2024
9af2a17
wip
stephencelis Apr 9, 2024
f68c1cd
wip
stephencelis Apr 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
  • Loading branch information
stephencelis committed Apr 9, 2024
commit ba30ab2b43802aa644acde914e5519ec1c598e22
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections",
"state" : {
"revision" : "d029d9d39c87bed85b1c50adee7c41795261a192",
"version" : "1.0.6"
"revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb",
"version" : "1.1.0"
}
},
{
Expand All @@ -129,7 +129,7 @@
{
"identity" : "swift-crypto",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-crypto",
"location" : "https://github.com/apple/swift-crypto.git",
"state" : {
"revision" : "ddb07e896a2a8af79512543b1c7eb9797f8898a5",
"version" : "1.1.7"
Expand All @@ -140,17 +140,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-custom-dump",
"state" : {
"revision" : "aedcf6f4cd486ccef5b312ccac85d4b3f6e58605",
"version" : "1.1.2"
"revision" : "f01efb26f3a192a0e88dcdb7c3c391ec2fc25d9c",
"version" : "1.3.0"
}
},
{
"identity" : "swift-dependencies",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-dependencies",
"state" : {
"revision" : "adb04a8e35f07edc001877af9f9f97fcc21d409e",
"version" : "1.2.0"
"revision" : "d3a5af3038a09add4d7682f66555d6212058a3c0",
"version" : "1.2.2"
}
},
{
Expand Down Expand Up @@ -212,17 +212,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "635b2589494c97e48c62514bc8b37ced762e0a62",
"version" : "2.63.0"
"revision" : "fc63f0cf4e55a4597407a9fc95b16a2bc44b4982",
"version" : "2.64.0"
}
},
{
"identity" : "swift-nio-extras",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-extras.git",
"state" : {
"revision" : "363da63c1966405764f380c627409b2f9d9e710b",
"version" : "1.21.0"
"revision" : "a3b640d7dc567225db7c94386a6e71aded1bfa63",
"version" : "1.22.0"
}
},
{
Expand Down Expand Up @@ -284,8 +284,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-perception",
"state" : {
"revision" : "42240120b2a8797595433288ab4118f8042214c3",
"version" : "1.1.1"
"revision" : "520c458a832d1287e6b698c5f657ae848fd696ff",
"version" : "1.1.4"
}
},
{
Expand All @@ -302,17 +302,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
"state" : {
"revision" : "8e68404f641300bfd0e37d478683bb275926760c",
"version" : "1.15.2"
"revision" : "625ccca8570773dd84a34ee51a81aa2bc5a4f97a",
"version" : "1.16.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax",
"state" : {
"revision" : "64889f0c732f210a935a0ad7cda38f77f876262d",
"version" : "509.1.1"
"revision" : "fa8f95c2d536d6620cc2f504ebe8a6167c9fc2dd",
"version" : "510.0.1"
}
},
{
Expand Down Expand Up @@ -365,17 +365,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swiftui-navigation",
"state" : {
"revision" : "78f9d72cf667adb47e2040aa373185c88c63f0dc",
"version" : "1.2.0"
"revision" : "2ec6c3a15293efff6083966b38439a4004f25565",
"version" : "1.3.0"
}
},
{
"identity" : "xctest-dynamic-overlay",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "b58e6627149808b40634c4552fcf2f44d0b3ca87",
"version" : "1.1.0"
"revision" : "6f30bdba373bbd7fbfe241dddd732651f2fbd1e2",
"version" : "1.1.2"
}
}
],
Expand Down
5 changes: 1 addition & 4 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ var package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-crypto", from: "1.1.6"),
.package(url: "https://github.com/pointfreeco/swift-case-paths", from: "1.1.0"),
.package(
url: "https://github.com/pointfreeco/swift-composable-architecture",
from: "1.9.2"
),
.package(url: "https://github.com/pointfreeco/swift-composable-architecture", from: "1.9.2"),
.package(url: "https://github.com/pointfreeco/swift-custom-dump", from: "1.0.0"),
.package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.1.0"),
.package(url: "https://github.com/pointfreeco/swift-gen", from: "0.3.0"),
Expand Down
6 changes: 5 additions & 1 deletion Tests/AppFeatureTests/PersistenceTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import XCTest
@testable import SoloFeature
@testable import UserDefaultsClient

@MainActor
class PersistenceTests: XCTestCase {
@MainActor
func testUnlimitedSaveAndQuit() async throws {
let saves = ActorIsolated<[Data]>([])

Expand Down Expand Up @@ -143,6 +143,7 @@ class PersistenceTests: XCTestCase {
}
}

@MainActor
func testUnlimitedAbandon() async throws {
let didArchiveGame = ActorIsolated(false)
let saves = ActorIsolated<[Data]>([])
Expand Down Expand Up @@ -206,6 +207,7 @@ class PersistenceTests: XCTestCase {
}
}

@MainActor
func testTimedAbandon() async {
let didArchiveGame = ActorIsolated(false)

Expand Down Expand Up @@ -254,6 +256,7 @@ class PersistenceTests: XCTestCase {
await didArchiveGame.withValue { XCTAssert($0) }
}

@MainActor
func testUnlimitedResume() async {
let savedGames = SavedGamesState(dailyChallengeUnlimited: nil, unlimited: .mock)
let store = TestStore(
Expand Down Expand Up @@ -282,6 +285,7 @@ class PersistenceTests: XCTestCase {
await task.cancel()
}

@MainActor
func testTurnBasedAbandon() async {
let store = TestStore(
initialState: AppReducer.State(
Expand Down
4 changes: 3 additions & 1 deletion Tests/AppFeatureTests/RemoteNotificationsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import XCTest

@testable import AppFeature

@MainActor
class RemoteNotificationsTests: XCTestCase {
@MainActor
func testRegisterForRemoteNotifications_OnActivate_Authorized() async {
let didRegisterForRemoteNotifications = ActorIsolated(false)
let requestedAuthorizationOptions = ActorIsolated<UNAuthorizationOptions?>(nil)
Expand Down Expand Up @@ -68,6 +68,7 @@ class RemoteNotificationsTests: XCTestCase {
await task.cancel()
}

@MainActor
func testRegisterForRemoteNotifications_NotAuthorized() async {
let didRegisterForRemoteNotifications = ActorIsolated(false)
let requestedAuthorizationOptions = ActorIsolated<UNAuthorizationOptions?>(nil)
Expand All @@ -94,6 +95,7 @@ class RemoteNotificationsTests: XCTestCase {
await task.cancel()
}

@MainActor
func testReceiveNotification_dailyChallengeEndsSoon() async {
let inProgressGame = InProgressGame.mock

Expand Down
16 changes: 11 additions & 5 deletions Tests/AppFeatureTests/TurnBasedTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ import XCTest
@testable import ComposableGameCenter
@testable import HomeFeature

@MainActor
class TurnBasedTests: XCTestCase {
let mainQueue = DispatchQueue.test
let mainRunLoop = RunLoop.test

@MainActor
func testNewGame() async throws {
try await withMainSerialExecutor {
let didEndTurnWithRequest = ActorIsolated<TurnBasedMatchClient.EndTurnRequest?>(nil)
Expand Down Expand Up @@ -113,13 +113,13 @@ class TurnBasedTests: XCTestCase {
await store.receive(\.home.serverConfigResponse) {
$0.home.hasChangelog = true
}
await store.receive(\.home.activeMatchesResponse.success)
await store.receive(\.home.dailyChallengeResponse.success) {
$0.home.dailyChallenges = dailyChallenges
}
await store.receive(\.home.weekInReviewResponse.success) {
$0.home.weekInReview = weekInReview
}
await store.receive(\.home.activeMatchesResponse.success)

await store.send(.home(.destination(.presented(.multiplayer(.startButtonTapped)))))

Expand Down Expand Up @@ -274,6 +274,7 @@ class TurnBasedTests: XCTestCase {
}
}

@MainActor
func testResumeGame() async {
await withMainSerialExecutor {
let listener = AsyncStreamProducer<LocalPlayerClient.ListenerEvent>()
Expand Down Expand Up @@ -338,13 +339,13 @@ class TurnBasedTests: XCTestCase {
await store.receive(\.home.serverConfigResponse) {
$0.home.hasChangelog = true
}
await store.receive(\.home.activeMatchesResponse.success)
await store.receive(\.home.dailyChallengeResponse.success) {
$0.home.dailyChallenges = dailyChallenges
}
await store.receive(\.home.weekInReviewResponse.success) {
$0.home.weekInReview = weekInReview
}
await store.receive(\.home.activeMatchesResponse.success)

listener.continuation
.yield(.turnBased(.receivedTurnEventForMatch(.inProgress, didBecomeActive: true)))
Expand Down Expand Up @@ -378,6 +379,7 @@ class TurnBasedTests: XCTestCase {
}
}

@MainActor
func testResumeForfeitedGame() async {
await withMainSerialExecutor {
let listener = AsyncStreamProducer<LocalPlayerClient.ListenerEvent>()
Expand Down Expand Up @@ -439,14 +441,14 @@ class TurnBasedTests: XCTestCase {
await store.receive(\.home.serverConfigResponse) {
$0.home.hasChangelog = true
}
await store.receive(\.home.activeMatchesResponse.success)
await store.receive(\.home.dailyChallengeResponse.success) {
$0.home.dailyChallenges = dailyChallenges
}
await store.receive(\.home.weekInReviewResponse.success) {
$0.home.weekInReview = weekInReview
}

await store.receive(\.home.activeMatchesResponse.success)

listener.continuation
.yield(.turnBased(.receivedTurnEventForMatch(.forfeited, didBecomeActive: true)))

Expand Down Expand Up @@ -488,6 +490,7 @@ class TurnBasedTests: XCTestCase {
}
}

@MainActor
func testRemovingCubes() async throws {
let didEndTurnWithRequest = ActorIsolated<TurnBasedMatchClient.EndTurnRequest?>(nil)
let match = update(TurnBasedMatch.inProgress) {
Expand Down Expand Up @@ -653,6 +656,7 @@ class TurnBasedTests: XCTestCase {
}
}

@MainActor
func testRematch() async {
let localParticipant = TurnBasedParticipant.local
let match = update(TurnBasedMatch.inProgress) {
Expand Down Expand Up @@ -737,6 +741,7 @@ class TurnBasedTests: XCTestCase {
}
}

@MainActor
func testGameCenterNotification_ShowsRecentTurn() async {
let localParticipant = TurnBasedParticipant.local
let remoteParticipant = update(TurnBasedParticipant.remote) {
Expand Down Expand Up @@ -805,6 +810,7 @@ class TurnBasedTests: XCTestCase {
}
}

@MainActor
func testGameCenterNotification_DoesNotShow() async {
let localParticipant = TurnBasedParticipant.local
let remoteParticipant = update(TurnBasedParticipant.remote) {
Expand Down
3 changes: 2 additions & 1 deletion Tests/AppFeatureTests/UserNotificationsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import XCTest

@testable import AppFeature

@MainActor
class UserNotificationsTests: XCTestCase {
@MainActor
func testReceiveBackgroundNotification() async {
let delegate = AsyncStream<UserNotificationClient.DelegateEvent>.makeStream()
let response = UserNotificationClient.Notification.Response(
Expand Down Expand Up @@ -43,6 +43,7 @@ class UserNotificationsTests: XCTestCase {
await task.cancel()
}

@MainActor
func testReceiveForegroundNotification() async {
let delegate = AsyncStream<UserNotificationClient.DelegateEvent>.makeStream()
let notification = UserNotificationClient.Notification(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import XCTest

@testable import LeaderboardFeature

@MainActor
class DailyChallengeFeatureTests: XCTestCase {
@MainActor
func testBasics() async {
await withMainSerialExecutor {
let uuid = UUID.incrementing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import XCTest
@testable import DailyChallengeFeature
@testable import SharedModels

@MainActor
class DailyChallengeFeatureTests: XCTestCase {
let mainQueue = DispatchQueue.test
let mainRunLoop = RunLoop.test

@MainActor
func testOnAppear() async {
let store = TestStore(initialState: DailyChallengeReducer.State()) {
DailyChallengeReducer()
Expand All @@ -36,6 +36,7 @@ class DailyChallengeFeatureTests: XCTestCase {
}
}

@MainActor
func testTapGameThatWasPlayed() async {
var dailyChallengeResponse = FetchTodaysDailyChallengeResponse.played
dailyChallengeResponse.dailyChallenge.endsAt = Date().addingTimeInterval(60 * 60 * 2 + 1)
Expand All @@ -53,6 +54,7 @@ class DailyChallengeFeatureTests: XCTestCase {
}
}

@MainActor
func testTapGameThatWasNotStarted() async {
var inProgressGame = InProgressGame.mock
inProgressGame.gameStartTime = self.mainRunLoop.now.date
Expand Down Expand Up @@ -100,6 +102,7 @@ class DailyChallengeFeatureTests: XCTestCase {
await store.receive(\.delegate.startGame)
}

@MainActor
func testTapGameThatWasStarted_NotPlayed_HasLocalGame() async {
var inProgressGame = InProgressGame.mock
inProgressGame.gameStartTime = .mock
Expand Down Expand Up @@ -132,6 +135,7 @@ class DailyChallengeFeatureTests: XCTestCase {
await store.receive(\.delegate.startGame)
}

@MainActor
func testNotifications_OpenThenClose() async {
let store = TestStore(
initialState: DailyChallengeReducer.State()
Expand All @@ -147,6 +151,7 @@ class DailyChallengeFeatureTests: XCTestCase {
}
}

@MainActor
func testNotifications_GrantAccess() async {
let didRegisterForRemoteNotifications = ActorIsolated(false)

Expand Down Expand Up @@ -181,6 +186,7 @@ class DailyChallengeFeatureTests: XCTestCase {
await didRegisterForRemoteNotifications.withValue { XCTAssertNoDifference($0, true) }
}

@MainActor
func testNotifications_DenyAccess() async {
let store = TestStore(initialState: DailyChallengeReducer.State()) {
DailyChallengeReducer()
Expand Down
Loading
Loading