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

chore: kickoff release #3319

Merged
merged 2 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .github/workflows/integ_test_datastore_auth_cognito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
scheme: AWSDataStorePluginAuthCognitoTests
destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4'
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-auth-cognito-test-tvOS:
timeout-minutes: 60
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest
sdk: appletvsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-auth-cognito-test-watchOS:
timeout-minutes: 60
Expand Down Expand Up @@ -93,3 +95,4 @@ jobs:
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=latest
sdk: watchsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'
3 changes: 3 additions & 0 deletions .github/workflows/integ_test_datastore_auth_iam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
scheme: AWSDataStorePluginAuthIAMTests
destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4'
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-auth-iam-test-tvOS:
timeout-minutes: 60
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest
sdk: appletvsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-auth-iam-test-watchOS:
timeout-minutes: 60
Expand Down Expand Up @@ -93,3 +95,4 @@ jobs:
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=latest
sdk: watchsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'
3 changes: 3 additions & 0 deletions .github/workflows/integ_test_datastore_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
scheme: AWSDataStorePluginIntegrationTests
destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4'
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-test-base-tvOS:
timeout-minutes: 60
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest
sdk: appletvsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-test-base-watchOS:
timeout-minutes: 60
Expand Down Expand Up @@ -93,3 +95,4 @@ jobs:
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=latest
sdk: watchsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'
3 changes: 3 additions & 0 deletions .github/workflows/integ_test_datastore_cpk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
scheme: AWSDataStorePluginCPKTests
destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4'
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-cpk-test-tvOS:
timeout-minutes: 60
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest
sdk: appletvsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-cpk-test-watchOS:
timeout-minutes: 60
Expand Down Expand Up @@ -93,3 +95,4 @@ jobs:
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=latest
sdk: watchsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'
3 changes: 3 additions & 0 deletions .github/workflows/integ_test_datastore_lazy_load.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
scheme: AWSDataStorePluginLazyLoadTests
destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4'
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-lazy-load-test-tvOS:
timeout-minutes: 60
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest
sdk: appletvsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-lazy-load-test-watchOS:
timeout-minutes: 60
Expand Down Expand Up @@ -93,3 +95,4 @@ jobs:
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=latest
sdk: watchsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'
3 changes: 3 additions & 0 deletions .github/workflows/integ_test_datastore_multi_auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
scheme: AWSDataStorePluginMultiAuthTests
destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4'
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-multi-auth-test-tvOS:
timeout-minutes: 60
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest
sdk: appletvsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-multi-auth-test-watchOS:
timeout-minutes: 60
Expand Down Expand Up @@ -93,3 +95,4 @@ jobs:
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=latest
sdk: watchsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'
3 changes: 3 additions & 0 deletions .github/workflows/integ_test_datastore_v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
scheme: AWSDataStorePluginV2Tests
destination: 'platform=iOS Simulator,name=iPhone 14,OS=16.4'
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-v2-test-tvOS:
timeout-minutes: 60
Expand Down Expand Up @@ -64,6 +65,7 @@ jobs:
destination: platform=tvOS Simulator,name=Apple TV 4K (3rd generation),OS=latest
sdk: appletvsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'

datastore-integration-v2-test-watchOS:
timeout-minutes: 60
Expand Down Expand Up @@ -93,3 +95,4 @@ jobs:
destination: platform=watchOS Simulator,name=Apple Watch Series 8 (45mm),OS=latest
sdk: watchsimulator
xcode_path: '/Applications/Xcode_14.3.app'
other_flags: '-test-iterations 3 -retry-tests-on-failure'
10 changes: 10 additions & 0 deletions Amplify/Categories/DataStore/Model/Lazy/List+Model.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ public class List<ModelType: Model>: Collection, Codable, ExpressibleByArrayLite

/// The current state of lazily loaded list
var loadedState: LoadedState

/// Boolean property to check if list is loaded
public var isLoaded: Bool {
if case .loaded = loadedState {
return true
}

return false
}

/// The provider for fulfilling list behaviors
let listProvider: AnyModelListProvider<Element>
Expand Down Expand Up @@ -61,6 +70,7 @@ public class List<ModelType: Model>: Collection, Codable, ExpressibleByArrayLite
}
}


// MARK: - Initializers

public init(listProvider: AnyModelListProvider<ModelType>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import Combine
import XCTest

@testable import Amplify
@testable import AmplifyTestCommon
@testable import AWSDataStorePlugin
import Amplify
import AmplifyTestCommon
import AWSDataStorePlugin

class ListTests: BaseDataStoreTests {

Expand All @@ -25,15 +25,9 @@ class ListTests: BaseDataStoreTests {
let postId = preparePostDataForTest()

func checkComments(_ comments: List<Comment>) async throws {
guard case .notLoaded = comments.loadedState else {
XCTFail("Should not be loaded")
return
}
XCTAssertFalse(comments.isLoaded)
try await comments.fetch()
guard case .loaded = comments.loadedState else {
XCTFail("Should be loaded")
return
}
XCTAssertTrue(comments.isLoaded)
XCTAssertEqual(comments.count, 2)
expect.fulfill()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class AWSDataStoreCategoryPluginAuthIntegrationTests: AWSDataStoreAuthBaseTest {

try await signIn(user: user1)

await fulfillment(of: [syncReceivedInvoked], timeout: TestCommonConstants.networkTimeout)
await fulfillment(of: [syncReceivedInvoked], timeout: 60)
Amplify.Hub.removeListener(syncReceivedListener)
guard let remoteTodo = remoteTodoOptional else {
XCTFail("Should have received a SyncReceived event with the remote note reconciled to local store")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,16 @@ class DataStoreObserveQueryTests: SyncEngineIntegrationTestBase {
}
}.store(in: &cancellables)
let receivedPost = expectation(description: "received Post")
try await savePostAndWaitForSync(Post(title: "title", content: "content", createdAt: .now()),
postSyncedExpctation: receivedPost)
await fulfillment(of: [snapshotWithIsSynced, receivedPost], timeout: 100)
receivedPost.assertForOverFulfill = false
try await savePostAndWaitForSync(
Post(
title: "title",
content: "content",
createdAt: .now()
),
postSyncedExpctation: receivedPost
)
await fulfillment(of: [snapshotWithIsSynced], timeout: 100)

XCTAssertTrue(snapshots.count >= 2)
XCTAssertFalse(snapshots[0].isSynced)
Expand Down Expand Up @@ -296,7 +303,7 @@ class DataStoreObserveQueryTests: SyncEngineIntegrationTestBase {
let receivedPost = expectation(description: "received Post")
try await savePostAndWaitForSync(Post(title: "title", content: "content", createdAt: .now()),
postSyncedExpctation: receivedPost)
await fulfillment(of: [snapshotWithIsSynced, receivedPost], timeout: 30)
await fulfillment(of: [snapshotWithIsSynced], timeout: 30)
XCTAssertTrue(snapshots.count >= 2)
XCTAssertFalse(snapshots[0].isSynced)
XCTAssertTrue(snapshots.last!.isSynced)
Expand Down
Loading