From 174bbfe5c057b0b3533022f3bb1f7fb807aaf565 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 31 Mar 2021 15:13:35 -0700 Subject: [PATCH 01/30] Remove test targets from Package.swift --- Package.swift | 106 +--------------------------------------- Package@swift-5.2.swift | 60 +---------------------- 2 files changed, 2 insertions(+), 164 deletions(-) diff --git a/Package.swift b/Package.swift index fdbbec3e8d..b4d548be3f 100644 --- a/Package.swift +++ b/Package.swift @@ -85,15 +85,6 @@ let package = Package( exclude: [ "Info.plist" ]), - .target( - name: "ApolloSQLiteTestSupport", - dependencies: [ - "ApolloSQLite", - "ApolloTestSupport" - ], - exclude: [ - "Info.plist" - ]), .target( name: "ApolloWebSocket", dependencies: [ @@ -103,101 +94,6 @@ let package = Package( ], exclude: [ "Info.plist" - ]), - .target( - name: "ApolloTestSupport", - dependencies: [ - "Apollo", - ], - exclude: [ - "Info.plist" - ]), - .target( - name: "AnimalKingdomAPI", - dependencies: [ - "ApolloCore", - ], - exclude: [ - "Info.plist", - "graphql" - ]), - .target( - name: "GitHubAPI", - dependencies: [ - "Apollo", - ], - exclude: [ - "Info.plist", - "graphql" - ]), - .target( - name: "StarWarsAPI", - dependencies: [ - "Apollo", - ], - exclude: [ - "Info.plist", - "graphql" - ]), - .target( - name: "UploadAPI", - dependencies: [ - "Apollo", - ], - exclude: [ - "Info.plist", - "graphql" - ]), - .testTarget( - name: "ApolloTests", - dependencies: [ - "ApolloTestSupport", - "StarWarsAPI", - "UploadAPI" - ], - exclude: [ - "Info.plist" - ], - resources: [ - .copy("Resources") - ]), - .testTarget( - name: "ApolloCacheDependentTests", - dependencies: [ - "ApolloSQLiteTestSupport", - "StarWarsAPI", - ], - exclude: [ - "Info.plist" - ]), - .testTarget( - name: "ApolloCodegenTests", - dependencies: [ - "ApolloTestSupport", - "ApolloCodegenLib" - ], - exclude: [ - "Info.plist", - "scripts directory" - ]), - .testTarget( - name: "ApolloSQLiteTests", - dependencies: [ - "ApolloSQLiteTestSupport", - "StarWarsAPI" - ], - exclude: [ - "Info.plist" - ]), - .testTarget( - name: "ApolloWebsocketTests", - dependencies: [ - "ApolloWebSocket", - "ApolloTestSupport", - "StarWarsAPI", - ], - exclude: [ - "Info.plist" - ]), + ]) ] ) diff --git a/Package@swift-5.2.swift b/Package@swift-5.2.swift index 1e5d637408..2ba7ae874f 100644 --- a/Package@swift-5.2.swift +++ b/Package@swift-5.2.swift @@ -62,70 +62,12 @@ let package = Package( "Apollo", .product(name: "SQLite", package: "SQLite.swift"), ]), - .target( - name: "ApolloSQLiteTestSupport", - dependencies: [ - "ApolloSQLite", - "ApolloTestSupport" - ]), .target( name: "ApolloWebSocket", dependencies: [ "Apollo", "ApolloCore", .product(name: "Starscream", package: "Starscream"), - ]), - .target( - name: "ApolloTestSupport", - dependencies: [ - "Apollo", - ]), - .target( - name: "GitHubAPI", - dependencies: [ - "Apollo", - ]), - .target( - name: "StarWarsAPI", - dependencies: [ - "Apollo", - ]), - .target( - name: "UploadAPI", - dependencies: [ - "Apollo", - ]), - .testTarget( - name: "ApolloTests", - dependencies: [ - "ApolloTestSupport", - "StarWarsAPI", - "UploadAPI" - ]), - .testTarget( - name: "ApolloCacheDependentTests", - dependencies: [ - "ApolloSQLiteTestSupport", - "StarWarsAPI", - ]), - .testTarget( - name: "ApolloCodegenTests", - dependencies: [ - "ApolloTestSupport", - "ApolloCodegenLib" - ]), - .testTarget( - name: "ApolloSQLiteTests", - dependencies: [ - "ApolloSQLiteTestSupport", - "StarWarsAPI" - ]), - .testTarget( - name: "ApolloWebsocketTests", - dependencies: [ - "ApolloWebSocket", - "ApolloTestSupport", - "StarWarsAPI", - ]), + ]) ] ) From 71529caa41aaef60ac9c140a44c705eb6dbc0795 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 31 Mar 2021 15:37:57 -0700 Subject: [PATCH 02/30] Create ServerIntegrationTest Target and add LegacyInterceptorProviderIntegrationTests WIP on UnitTestPlan --- Apollo.xcodeproj/project.pbxproj | 161 ++++++++++++++++++ ...llo-Target-ServerIntegrationTests.xcconfig | 3 + .../UnitTestPlan.xctestplan | 24 +++ .../ApolloServerIntegrationTests.swift | 76 +++++++++ Tests/ApolloServerIntegrationTests/Info.plist | 22 +++ .../TestServerURLs.swift | 11 ++ 6 files changed, 297 insertions(+) create mode 100644 Configuration/Apollo/Apollo-Target-ServerIntegrationTests.xcconfig create mode 100644 Tests/ApolloCacheDependentTests/UnitTestPlan.xctestplan create mode 100644 Tests/ApolloServerIntegrationTests/ApolloServerIntegrationTests.swift create mode 100644 Tests/ApolloServerIntegrationTests/Info.plist create mode 100644 Tests/ApolloServerIntegrationTests/TestServerURLs.swift diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index 22adc34a43..e7a5b79a04 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -287,6 +287,9 @@ DE3C7B4A260A73D800D2F4FF /* AnimalKingdomAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = DE3C79A9260A6ACD00D2F4FF /* AnimalKingdomAPI.h */; settings = {ATTRIBUTES = (Public, ); }; }; DE3C7B4B260A73F900D2F4FF /* schema.graphqls in Resources */ = {isa = PBXBuildFile; fileRef = DE3C7AB9260A6D3E00D2F4FF /* schema.graphqls */; }; DE6B156A261505660068D642 /* GraphQLMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6B154A261505450068D642 /* GraphQLMap.swift */; }; + DE6B15AF26152BE10068D642 /* ApolloServerIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6B15AE26152BE10068D642 /* ApolloServerIntegrationTests.swift */; }; + DE6B15B126152BE10068D642 /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; }; + DED45C182615308E0086EF63 /* TestServerURLs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45C172615308E0086EF63 /* TestServerURLs.swift */; }; E86D8E05214B32FD0028EFE1 /* JSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86D8E03214B32DA0028EFE1 /* JSONTests.swift */; }; F16D083C21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */; }; F82E62E122BCD223000C311B /* AutomaticPersistedQueriesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */; }; @@ -517,6 +520,13 @@ remoteGlobalIDString = 9B68353D2463481A00337AE6; remoteInfo = ApolloCore; }; + DE6B15B226152BE10068D642 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9FC750431D2A532C00458D91; + remoteInfo = Apollo; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -889,7 +899,33 @@ DE3C7B14260A6FCA00D2F4FF /* GraphQLEnum.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphQLEnum.swift; sourceTree = ""; }; DE3C7B15260A6FCA00D2F4FF /* ScalarTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScalarTypes.swift; sourceTree = ""; }; DE6B154A261505450068D642 /* GraphQLMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphQLMap.swift; sourceTree = ""; }; + DE6B15892615294F0068D642 /* UnitTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = UnitTestPlan.xctestplan; path = ApolloCacheDependentTests/UnitTestPlan.xctestplan; sourceTree = ""; }; + DE6B15AC26152BE10068D642 /* ApolloServerIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ApolloServerIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + DE6B15AE26152BE10068D642 /* ApolloServerIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApolloServerIntegrationTests.swift; sourceTree = ""; }; + DE6B15B026152BE10068D642 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + DE6B15E826152CD80068D642 /* Apollo-Target-ServerIntegrationTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-ServerIntegrationTests.xcconfig"; sourceTree = ""; }; + DE6B15FA26152D210068D642 /* Workspace-Target-Application.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Target-Application.xcconfig"; sourceTree = ""; }; + DE6B15FB26152D210068D642 /* Workspace-Deployment-Targets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Deployment-Targets.xcconfig"; sourceTree = ""; }; + DE6B15FC26152D210068D642 /* Workspace-Analysis.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Analysis.xcconfig"; sourceTree = ""; }; + DE6B15FD26152D210068D642 /* Project-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Release.xcconfig"; sourceTree = ""; }; + DE6B15FE26152D210068D642 /* Workspace-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Debug.xcconfig"; sourceTree = ""; }; + DE6B15FF26152D210068D642 /* Workspace-Universal-Test.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Universal-Test.xcconfig"; sourceTree = ""; }; + DE6B160026152D210068D642 /* Workspace-Universal-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Universal-Framework.xcconfig"; sourceTree = ""; }; + DE6B160126152D210068D642 /* Workspace-Target-Test.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Target-Test.xcconfig"; sourceTree = ""; }; + DE6B160226152D210068D642 /* Workspace-Code-Generation.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Code-Generation.xcconfig"; sourceTree = ""; }; + DE6B160326152D210068D642 /* Workspace-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Release.xcconfig"; sourceTree = ""; }; + DE6B160426152D210068D642 /* Project-Version.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Version.xcconfig"; sourceTree = ""; }; + DE6B160526152D210068D642 /* Workspace-Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Warnings.xcconfig"; sourceTree = ""; }; + DE6B160626152D210068D642 /* Workspace-Target-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Target-Framework.xcconfig"; sourceTree = ""; }; + DE6B160726152D210068D642 /* Workspace-Search-Paths.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Search-Paths.xcconfig"; sourceTree = ""; }; + DE6B160826152D210068D642 /* Workspace-Universal-Target.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Universal-Target.xcconfig"; sourceTree = ""; }; + DE6B160926152D210068D642 /* Workspace-Linking.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Linking.xcconfig"; sourceTree = ""; }; + DE6B160A26152D210068D642 /* Workspace-Language.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Language.xcconfig"; sourceTree = ""; }; + DE6B160B26152D210068D642 /* Project-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Project-Debug.xcconfig"; sourceTree = ""; }; + DE6B160C26152D210068D642 /* Workspace-Packaging.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Packaging.xcconfig"; sourceTree = ""; }; + DE6B160D26152D210068D642 /* Workspace-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Shared.xcconfig"; sourceTree = ""; }; DEA34AF6260E821F00F95F86 /* Apollo-Target-AnimalKingdomAPI.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-AnimalKingdomAPI.xcconfig"; sourceTree = ""; }; + DED45C172615308E0086EF63 /* TestServerURLs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestServerURLs.swift; sourceTree = ""; }; E86D8E03214B32DA0028EFE1 /* JSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONTests.swift; sourceTree = ""; }; F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueryFromJSONBuildingTests.swift; sourceTree = ""; }; F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutomaticPersistedQueriesTests.swift; sourceTree = ""; }; @@ -1040,12 +1076,21 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DE6B15A926152BE10068D642 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DE6B15B126152BE10068D642 /* Apollo.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 90690D04224333DA00FC2E54 /* Configuration */ = { isa = PBXGroup; children = ( + DE6B15F926152D210068D642 /* Shared */, 90690D05224333DA00FC2E54 /* Apollo-Project-Debug.xcconfig */, 90690D08224333DA00FC2E54 /* Apollo-Project-Performance-Testing.xcconfig */, 90690D07224333DA00FC2E54 /* Apollo-Project-Release.xcconfig */, @@ -1061,6 +1106,7 @@ 90690D2122433C1900FC2E54 /* Apollo-Target-StarWarsAPI.xcconfig */, 90690D142243363D00FC2E54 /* Apollo-Target-TestHost-iOS.xcconfig */, 90690D0B2243345500FC2E54 /* Apollo-Target-Tests.xcconfig */, + DE6B15E826152CD80068D642 /* Apollo-Target-ServerIntegrationTests.xcconfig */, 90690D2522433CAF00FC2E54 /* Apollo-Target-TestSupport.xcconfig */, 9B2DFBC824E1FA7E00ED3AE6 /* Apollo-Target-UploadAPI.xcconfig */, 9B7BDAD923FDECB400ACD198 /* ApolloSQLite-Project-Debug.xcconfig */, @@ -1706,6 +1752,7 @@ 9B2DFBCA24E2016800ED3AE6 /* UploadAPI.framework */, 9F54C8B4255D760B0065AFD6 /* ApolloPerformanceTests.xctest */, DE3C7A11260A6B9800D2F4FF /* AnimalKingdomAPI.framework */, + DE6B15AC26152BE10068D642 /* ApolloServerIntegrationTests.xctest */, ); name = Products; sourceTree = ""; @@ -1815,10 +1862,12 @@ 9FCE2CF41E6C20E000E34457 /* Tests */ = { isa = PBXGroup; children = ( + DE6B15892615294F0068D642 /* UnitTestPlan.xctestplan */, 9FC750521D2A532D00458D91 /* ApolloTests */, 9FA6ABBD1EC0A988000017BE /* ApolloCacheDependentTests */, 9F54C8B5255D760B0065AFD6 /* ApolloPerformanceTests */, 9BAEEC0A234BB95B00808306 /* ApolloCodegenTests */, + DE6B15AD26152BE10068D642 /* ApolloServerIntegrationTests */, 9B7BDAD323FDEC9B00ACD198 /* ApolloSQLiteTests */, 9B7BDAEB23FDED9700ACD198 /* ApolloSQLiteTestSupport */, 9BCF0CD823FC9CA50031D2A2 /* ApolloTestSupport */, @@ -1899,6 +1948,44 @@ path = CodegenCore; sourceTree = ""; }; + DE6B15AD26152BE10068D642 /* ApolloServerIntegrationTests */ = { + isa = PBXGroup; + children = ( + DE6B15AE26152BE10068D642 /* ApolloServerIntegrationTests.swift */, + DED45C172615308E0086EF63 /* TestServerURLs.swift */, + DE6B15B026152BE10068D642 /* Info.plist */, + ); + path = ApolloServerIntegrationTests; + sourceTree = ""; + }; + DE6B15F926152D210068D642 /* Shared */ = { + isa = PBXGroup; + children = ( + DE6B15FA26152D210068D642 /* Workspace-Target-Application.xcconfig */, + DE6B15FB26152D210068D642 /* Workspace-Deployment-Targets.xcconfig */, + DE6B15FC26152D210068D642 /* Workspace-Analysis.xcconfig */, + DE6B15FD26152D210068D642 /* Project-Release.xcconfig */, + DE6B15FE26152D210068D642 /* Workspace-Debug.xcconfig */, + DE6B15FF26152D210068D642 /* Workspace-Universal-Test.xcconfig */, + DE6B160026152D210068D642 /* Workspace-Universal-Framework.xcconfig */, + DE6B160126152D210068D642 /* Workspace-Target-Test.xcconfig */, + DE6B160226152D210068D642 /* Workspace-Code-Generation.xcconfig */, + DE6B160326152D210068D642 /* Workspace-Release.xcconfig */, + DE6B160426152D210068D642 /* Project-Version.xcconfig */, + DE6B160526152D210068D642 /* Workspace-Warnings.xcconfig */, + DE6B160626152D210068D642 /* Workspace-Target-Framework.xcconfig */, + DE6B160726152D210068D642 /* Workspace-Search-Paths.xcconfig */, + DE6B160826152D210068D642 /* Workspace-Universal-Target.xcconfig */, + DE6B160926152D210068D642 /* Workspace-Linking.xcconfig */, + DE6B160A26152D210068D642 /* Workspace-Language.xcconfig */, + DE6B160B26152D210068D642 /* Project-Debug.xcconfig */, + DE6B160C26152D210068D642 /* Workspace-Packaging.xcconfig */, + DE6B160D26152D210068D642 /* Workspace-Shared.xcconfig */, + ); + name = Shared; + path = Configuration/Shared; + sourceTree = SOURCE_ROOT; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -2336,6 +2423,24 @@ productReference = DE3C7A11260A6B9800D2F4FF /* AnimalKingdomAPI.framework */; productType = "com.apple.product-type.framework"; }; + DE6B15AB26152BE10068D642 /* ApolloServerIntegrationTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = DE6B15B726152BE10068D642 /* Build configuration list for PBXNativeTarget "ApolloServerIntegrationTests" */; + buildPhases = ( + DE6B15A826152BE10068D642 /* Sources */, + DE6B15A926152BE10068D642 /* Frameworks */, + DE6B15AA26152BE10068D642 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + DE6B15B326152BE10068D642 /* PBXTargetDependency */, + ); + name = ApolloServerIntegrationTests; + productName = ApolloServerIntegrationTests; + productReference = DE6B15AC26152BE10068D642 /* ApolloServerIntegrationTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -2408,6 +2513,9 @@ LastSwiftMigration = 1020; ProvisioningStyle = Manual; }; + DE6B15AB26152BE10068D642 = { + CreatedOnToolsVersion = 12.4; + }; }; }; buildConfigurationList = 9FC7503E1D2A532C00458D91 /* Build configuration list for PBXProject "Apollo" */; @@ -2446,6 +2554,7 @@ 9B7BDAB023FDEBA800ACD198 /* ApolloSQLiteTests */, 9B7BDA7C23FDE90400ACD198 /* ApolloWebSocket */, 9B7BDA6E23FDE8F200ACD198 /* ApolloWebSocketTests */, + DE6B15AB26152BE10068D642 /* ApolloServerIntegrationTests */, ); }; /* End PBXProject section */ @@ -2557,6 +2666,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DE6B15AA26152BE10068D642 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -2866,6 +2982,7 @@ 54DDB0921EA045870009DD99 /* InMemoryNormalizedCache.swift in Sources */, 9FC9A9C51E2D6CE70023C4D5 /* GraphQLSelectionSet.swift in Sources */, DE6B156A261505660068D642 /* GraphQLMap.swift in Sources */, + DED45C182615308E0086EF63 /* TestServerURLs.swift in Sources */, 9B554CC4247DC29A002F452A /* TaskData.swift in Sources */, 9B9BBAF524DB4F890021C30F /* AutomaticPersistedQueryInterceptor.swift in Sources */, 9BA1244A22D8A8EA00BF1D24 /* JSONSerialization+Sorting.swift in Sources */, @@ -2963,6 +3080,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DE6B15A826152BE10068D642 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DE6B15AF26152BE10068D642 /* ApolloServerIntegrationTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -3134,6 +3259,11 @@ target = 9B68353D2463481A00337AE6 /* ApolloCore */; targetProxy = DE3C7A96260A6C1000D2F4FF /* PBXContainerItemProxy */; }; + DE6B15B326152BE10068D642 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9FC750431D2A532C00458D91 /* Apollo */; + targetProxy = DE6B15B226152BE10068D642 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -3515,6 +3645,27 @@ }; name = PerformanceTesting; }; + DE6B15B426152BE10068D642 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DE6B15E826152CD80068D642 /* Apollo-Target-ServerIntegrationTests.xcconfig */; + buildSettings = { + }; + name = Debug; + }; + DE6B15B526152BE10068D642 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DE6B15E826152CD80068D642 /* Apollo-Target-ServerIntegrationTests.xcconfig */; + buildSettings = { + }; + name = Release; + }; + DE6B15B626152BE10068D642 /* PerformanceTesting */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = DE6B15E826152CD80068D642 /* Apollo-Target-ServerIntegrationTests.xcconfig */; + buildSettings = { + }; + name = PerformanceTesting; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -3698,6 +3849,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + DE6B15B726152BE10068D642 /* Build configuration list for PBXNativeTarget "ApolloServerIntegrationTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + DE6B15B426152BE10068D642 /* Debug */, + DE6B15B526152BE10068D642 /* Release */, + DE6B15B626152BE10068D642 /* PerformanceTesting */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ /* Begin XCRemoteSwiftPackageReference section */ diff --git a/Configuration/Apollo/Apollo-Target-ServerIntegrationTests.xcconfig b/Configuration/Apollo/Apollo-Target-ServerIntegrationTests.xcconfig new file mode 100644 index 0000000000..1f3fc5792f --- /dev/null +++ b/Configuration/Apollo/Apollo-Target-ServerIntegrationTests.xcconfig @@ -0,0 +1,3 @@ +#include "../Shared/Workspace-Universal-Test.xcconfig" + +INFOPLIST_FILE = Tests/ApolloServerIntegrationTests/Info.plist diff --git a/Tests/ApolloCacheDependentTests/UnitTestPlan.xctestplan b/Tests/ApolloCacheDependentTests/UnitTestPlan.xctestplan new file mode 100644 index 0000000000..fe77778b88 --- /dev/null +++ b/Tests/ApolloCacheDependentTests/UnitTestPlan.xctestplan @@ -0,0 +1,24 @@ +{ + "configurations" : [ + { + "id" : "9CB34656-EFF8-410B-8F79-EF3152F0BDC6", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:Apollo.xcodeproj", + "identifier" : "9FC7504D1D2A532D00458D91", + "name" : "ApolloTests" + } + } + ], + "version" : 1 +} diff --git a/Tests/ApolloServerIntegrationTests/ApolloServerIntegrationTests.swift b/Tests/ApolloServerIntegrationTests/ApolloServerIntegrationTests.swift new file mode 100644 index 0000000000..00e73d33a2 --- /dev/null +++ b/Tests/ApolloServerIntegrationTests/ApolloServerIntegrationTests.swift @@ -0,0 +1,76 @@ +import Apollo +import XCTest + +/// Tests that the `LegacyInterceptorProvider` configures an `ApolloClient` that successfully +/// communicates with an external Apollo Server. +/// +/// - Precondition: These tests will only pass if a local instance of the Star Wars server is +/// running on port 8080. +/// This server can be found at https://github.com/apollographql/starwars-server +class LegacyInterceptorProviderIntegrationTests: XCTestCase { + + var legacyClient: ApolloClient! + + override func setUp() { + let url = TestServerURL.starWarsServer.url + let store = ApolloStore() + let provider = LegacyInterceptorProvider(store: store) + let transport = RequestChainNetworkTransport(interceptorProvider: provider, + endpointURL: url) + + legacyClient = ApolloClient(networkTransport: transport, store: store) + } + + override func tearDown() { + legacyClient = nil + } + + func testLoading() { + let expectation = self.expectation(description: "loaded With legacy client") + legacyClient.fetch(query: HeroNameQuery()) { result in + switch result { + case .success(let graphQLResult): + XCTAssertEqual(graphQLResult.source, .server) + XCTAssertEqual(graphQLResult.data?.hero?.name, "R2-D2") + case .failure(let error): + XCTFail("Unexpected error: \(error)") + + } + expectation.fulfill() + } + + self.wait(for: [expectation], timeout: 10) + } + + func testInitialLoadFromNetworkAndSecondaryLoadFromCache() { + let initialLoadExpectation = self.expectation(description: "loaded With legacy client") + legacyClient.fetch(query: HeroNameQuery()) { result in + switch result { + case .success(let graphQLResult): + XCTAssertEqual(graphQLResult.source, .server) + XCTAssertEqual(graphQLResult.data?.hero?.name, "R2-D2") + case .failure(let error): + XCTFail("Unexpected error: \(error)") + + } + initialLoadExpectation.fulfill() + } + + self.wait(for: [initialLoadExpectation], timeout: 10) + + let secondLoadExpectation = self.expectation(description: "loaded With legacy client") + legacyClient.fetch(query: HeroNameQuery()) { result in + switch result { + case .success(let graphQLResult): + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertEqual(graphQLResult.data?.hero?.name, "R2-D2") + case .failure(let error): + XCTFail("Unexpected error: \(error)") + + } + secondLoadExpectation.fulfill() + } + + self.wait(for: [secondLoadExpectation], timeout: 10) + } +} diff --git a/Tests/ApolloServerIntegrationTests/Info.plist b/Tests/ApolloServerIntegrationTests/Info.plist new file mode 100644 index 0000000000..64d65ca495 --- /dev/null +++ b/Tests/ApolloServerIntegrationTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/Tests/ApolloServerIntegrationTests/TestServerURLs.swift b/Tests/ApolloServerIntegrationTests/TestServerURLs.swift new file mode 100644 index 0000000000..eef3a78c14 --- /dev/null +++ b/Tests/ApolloServerIntegrationTests/TestServerURLs.swift @@ -0,0 +1,11 @@ +/// Local URLs for servers used in integration testing +public enum TestServerURL: String { + case mockServer = "http://localhost/dummy_url" + case starWarsServer = "http://localhost:8080/graphql" + case starWarsWebSocket = "ws://localhost:8080/websocket" + case uploadServer = "http://localhost:4000" + + public var url: URL { + return URL(string: self.rawValue)! + } +} From 70341b31ecab28357fafba31c7fd02528723f29b Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 31 Mar 2021 15:53:17 -0700 Subject: [PATCH 03/30] Refactor LegacyInterceptorProviderTests to unit tests and move them out of RequestChainTests --- Apollo.xcodeproj/project.pbxproj | 12 ++- .../SQLiteCacheTests.swift | 2 + ...InterceptorProviderIntegrationTests.swift} | 0 .../LegacyInterceptorProviderTests.swift | 83 +++++++++++++++++++ Tests/ApolloTests/RequestChainTests.swift | 61 +------------- 5 files changed, 94 insertions(+), 64 deletions(-) rename Tests/ApolloServerIntegrationTests/{ApolloServerIntegrationTests.swift => LegacyInterceptorProviderIntegrationTests.swift} (100%) create mode 100644 Tests/ApolloTests/LegacyInterceptorProviderTests.swift diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index e7a5b79a04..1c022c818d 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -287,9 +287,10 @@ DE3C7B4A260A73D800D2F4FF /* AnimalKingdomAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = DE3C79A9260A6ACD00D2F4FF /* AnimalKingdomAPI.h */; settings = {ATTRIBUTES = (Public, ); }; }; DE3C7B4B260A73F900D2F4FF /* schema.graphqls in Resources */ = {isa = PBXBuildFile; fileRef = DE3C7AB9260A6D3E00D2F4FF /* schema.graphqls */; }; DE6B156A261505660068D642 /* GraphQLMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6B154A261505450068D642 /* GraphQLMap.swift */; }; - DE6B15AF26152BE10068D642 /* ApolloServerIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6B15AE26152BE10068D642 /* ApolloServerIntegrationTests.swift */; }; + DE6B15AF26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6B15AE26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift */; }; DE6B15B126152BE10068D642 /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; }; DED45C182615308E0086EF63 /* TestServerURLs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45C172615308E0086EF63 /* TestServerURLs.swift */; }; + DED45C2A2615319E0086EF63 /* LegacyInterceptorProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45C292615319E0086EF63 /* LegacyInterceptorProviderTests.swift */; }; E86D8E05214B32FD0028EFE1 /* JSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86D8E03214B32DA0028EFE1 /* JSONTests.swift */; }; F16D083C21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */; }; F82E62E122BCD223000C311B /* AutomaticPersistedQueriesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */; }; @@ -901,7 +902,7 @@ DE6B154A261505450068D642 /* GraphQLMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphQLMap.swift; sourceTree = ""; }; DE6B15892615294F0068D642 /* UnitTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = UnitTestPlan.xctestplan; path = ApolloCacheDependentTests/UnitTestPlan.xctestplan; sourceTree = ""; }; DE6B15AC26152BE10068D642 /* ApolloServerIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ApolloServerIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - DE6B15AE26152BE10068D642 /* ApolloServerIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ApolloServerIntegrationTests.swift; sourceTree = ""; }; + DE6B15AE26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyInterceptorProviderIntegrationTests.swift; sourceTree = ""; }; DE6B15B026152BE10068D642 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DE6B15E826152CD80068D642 /* Apollo-Target-ServerIntegrationTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-ServerIntegrationTests.xcconfig"; sourceTree = ""; }; DE6B15FA26152D210068D642 /* Workspace-Target-Application.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Target-Application.xcconfig"; sourceTree = ""; }; @@ -926,6 +927,7 @@ DE6B160D26152D210068D642 /* Workspace-Shared.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Workspace-Shared.xcconfig"; sourceTree = ""; }; DEA34AF6260E821F00F95F86 /* Apollo-Target-AnimalKingdomAPI.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-AnimalKingdomAPI.xcconfig"; sourceTree = ""; }; DED45C172615308E0086EF63 /* TestServerURLs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestServerURLs.swift; sourceTree = ""; }; + DED45C292615319E0086EF63 /* LegacyInterceptorProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyInterceptorProviderTests.swift; sourceTree = ""; }; E86D8E03214B32DA0028EFE1 /* JSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONTests.swift; sourceTree = ""; }; F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueryFromJSONBuildingTests.swift; sourceTree = ""; }; F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutomaticPersistedQueriesTests.swift; sourceTree = ""; }; @@ -1804,6 +1806,7 @@ F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */, 9FF90A6B1DDDEB420034C3B6 /* ReadFieldValueTests.swift */, 9B96500824BE6201003C29C0 /* RequestChainTests.swift */, + DED45C292615319E0086EF63 /* LegacyInterceptorProviderTests.swift */, C338DF1622DD9DE9006AF33E /* RequestBodyCreatorTests.swift */, 9B4F4542244A2AD300C2CF7D /* URLSessionClientTests.swift */, 9B9BBB1A24DB75E60021C30F /* UploadTests.swift */, @@ -1951,7 +1954,7 @@ DE6B15AD26152BE10068D642 /* ApolloServerIntegrationTests */ = { isa = PBXGroup; children = ( - DE6B15AE26152BE10068D642 /* ApolloServerIntegrationTests.swift */, + DE6B15AE26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift */, DED45C172615308E0086EF63 /* TestServerURLs.swift */, DE6B15B026152BE10068D642 /* Info.plist */, ); @@ -3052,6 +3055,7 @@ 9B21FD752422C29D00998B5C /* GraphQLFileTests.swift in Sources */, E86D8E05214B32FD0028EFE1 /* JSONTests.swift in Sources */, 9F8622FA1EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift in Sources */, + DED45C2A2615319E0086EF63 /* LegacyInterceptorProviderTests.swift in Sources */, 9F21730E2567E6F000566121 /* DataLoaderTests.swift in Sources */, C338DF1722DD9DE9006AF33E /* RequestBodyCreatorTests.swift in Sources */, F16D083C21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift in Sources */, @@ -3084,7 +3088,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DE6B15AF26152BE10068D642 /* ApolloServerIntegrationTests.swift in Sources */, + DE6B15AF26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift b/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift index c559a208d8..944a42f8c6 100644 --- a/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift +++ b/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift @@ -2,6 +2,8 @@ import Foundation import ApolloTestSupport import ApolloSQLiteTestSupport +// These test cases inherit all tests from their superclasses. + class SQLiteFetchQueryTests: FetchQueryTests { override var cacheType: TestCacheProvider.Type { SQLiteTestCacheProvider.self diff --git a/Tests/ApolloServerIntegrationTests/ApolloServerIntegrationTests.swift b/Tests/ApolloServerIntegrationTests/LegacyInterceptorProviderIntegrationTests.swift similarity index 100% rename from Tests/ApolloServerIntegrationTests/ApolloServerIntegrationTests.swift rename to Tests/ApolloServerIntegrationTests/LegacyInterceptorProviderIntegrationTests.swift diff --git a/Tests/ApolloTests/LegacyInterceptorProviderTests.swift b/Tests/ApolloTests/LegacyInterceptorProviderTests.swift new file mode 100644 index 0000000000..11c2acb5d8 --- /dev/null +++ b/Tests/ApolloTests/LegacyInterceptorProviderTests.swift @@ -0,0 +1,83 @@ +import XCTest +import Apollo +import ApolloTestSupport +import StarWarsAPI + +class LegacyInterceptorProviderTests: XCTestCase { + + var client: ApolloClient! + var mockServer: MockGraphQLServer! + + static let mockData: JSONObject = [ + "data": [ + "hero": [ + "name": "R2-D2", + "__typename": "Droid" + ] + ] + ] + + override func setUp() { + mockServer = MockGraphQLServer() + let store = ApolloStore() + let networkTransport = MockNetworkTransport(server: mockServer, store: store) + client = ApolloClient(networkTransport: networkTransport, store: store) + } + + override func tearDown() { + client = nil + } + + func testLoading() { + let expectation = mockServer.expect(HeroNameQuery.self) { _ in + LegacyInterceptorProviderTests.mockData + } + + client.fetch(query: HeroNameQuery()) { result in + switch result { + case .success(let graphQLResult): + XCTAssertEqual(graphQLResult.source, .server) + XCTAssertEqual(graphQLResult.data?.hero?.name, "R2-D2") + case .failure(let error): + XCTFail("Unexpected error: \(error)") + } + } + + self.wait(for: [expectation], timeout: 10) + } + + func testInitialLoadFromNetworkAndSecondaryLoadFromCache() { + let initialLoadExpectation = mockServer.expect(HeroNameQuery.self) { _ in + LegacyInterceptorProviderTests.mockData + } + initialLoadExpectation.assertForOverFulfill = false + + client.fetch(query: HeroNameQuery()) { result in + switch result { + case .success(let graphQLResult): + XCTAssertEqual(graphQLResult.source, .server) + XCTAssertEqual(graphQLResult.data?.hero?.name, "R2-D2") + case .failure(let error): + XCTFail("Unexpected error: \(error)") + } + } + + self.wait(for: [initialLoadExpectation], timeout: 10) + + let secondLoadExpectation = self.expectation(description: "loaded With legacy client") + + client.fetch(query: HeroNameQuery()) { result in + switch result { + case .success(let graphQLResult): + XCTAssertEqual(graphQLResult.source, .cache) + XCTAssertEqual(graphQLResult.data?.hero?.name, "R2-D2") + case .failure(let error): + XCTFail("Unexpected error: \(error)") + + } + secondLoadExpectation.fulfill() + } + + self.wait(for: [secondLoadExpectation], timeout: 10) + } +} diff --git a/Tests/ApolloTests/RequestChainTests.swift b/Tests/ApolloTests/RequestChainTests.swift index ddb007461c..3fbe59fb1c 100644 --- a/Tests/ApolloTests/RequestChainTests.swift +++ b/Tests/ApolloTests/RequestChainTests.swift @@ -12,66 +12,7 @@ import ApolloTestSupport import StarWarsAPI class RequestChainTests: XCTestCase { - - lazy var legacyClient: ApolloClient = { - let url = TestURL.starWarsServer.url - let store = ApolloStore() - let provider = LegacyInterceptorProvider(store: store) - let transport = RequestChainNetworkTransport(interceptorProvider: provider, - endpointURL: url) - - return ApolloClient(networkTransport: transport, store: store) - }() - - func testLoading() { - let expectation = self.expectation(description: "loaded With legacy client") - legacyClient.fetch(query: HeroNameQuery()) { result in - switch result { - case .success(let graphQLResult): - XCTAssertEqual(graphQLResult.source, .server) - XCTAssertEqual(graphQLResult.data?.hero?.name, "R2-D2") - case .failure(let error): - XCTFail("Unexpected error: \(error)") - - } - expectation.fulfill() - } - - self.wait(for: [expectation], timeout: 10) - } - - func testInitialLoadFromNetworkAndSecondaryLoadFromCache() { - let initialLoadExpectation = self.expectation(description: "loaded With legacy client") - legacyClient.fetch(query: HeroNameQuery()) { result in - switch result { - case .success(let graphQLResult): - XCTAssertEqual(graphQLResult.source, .server) - XCTAssertEqual(graphQLResult.data?.hero?.name, "R2-D2") - case .failure(let error): - XCTFail("Unexpected error: \(error)") - - } - initialLoadExpectation.fulfill() - } - - self.wait(for: [initialLoadExpectation], timeout: 10) - - let secondLoadExpectation = self.expectation(description: "loaded With legacy client") - legacyClient.fetch(query: HeroNameQuery()) { result in - switch result { - case .success(let graphQLResult): - XCTAssertEqual(graphQLResult.source, .cache) - XCTAssertEqual(graphQLResult.data?.hero?.name, "R2-D2") - case .failure(let error): - XCTFail("Unexpected error: \(error)") - - } - secondLoadExpectation.fulfill() - } - - self.wait(for: [secondLoadExpectation], timeout: 10) - } - + func testEmptyInterceptorArrayReturnsCorrectError() { class TestProvider: InterceptorProvider { func interceptors(for operation: Operation) -> [ApolloInterceptor] { From 2f64d59264375ec86b81f50e82b442a07585b743 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Thu, 1 Apr 2021 15:27:11 -0700 Subject: [PATCH 04/30] Move StarWarsServer Tests into integration test target --- Apollo.xcodeproj/project.pbxproj | 26 +++++-- .../SQLiteCacheTests.swift | 24 ------- .../StarWarsServerCachingRoundtripTests.swift | 7 ++ .../StarWarsServerTests.swift | 67 ++++++------------- .../TestHelpers/TestConfigs.swift | 47 +++++++++++++ .../{ => TestHelpers}/TestServerURLs.swift | 0 6 files changed, 93 insertions(+), 78 deletions(-) rename Tests/{ApolloCacheDependentTests => ApolloServerIntegrationTests}/StarWarsServerCachingRoundtripTests.swift (94%) rename Tests/{ApolloCacheDependentTests => ApolloServerIntegrationTests}/StarWarsServerTests.swift (88%) create mode 100644 Tests/ApolloServerIntegrationTests/TestHelpers/TestConfigs.swift rename Tests/ApolloServerIntegrationTests/{ => TestHelpers}/TestServerURLs.swift (100%) diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index 1c022c818d..fa3f7ee43f 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -234,8 +234,6 @@ 9F8F334C229044A200C0E83B /* Decoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8F334B229044A200C0E83B /* Decoding.swift */; }; 9F91CF8F1F6C0DB2008DD0BE /* MutatingResultsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F91CF8E1F6C0DB2008DD0BE /* MutatingResultsTests.swift */; }; 9FA6ABCD1EC0A9F7000017BE /* LoadQueryFromStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC61EC0A9F7000017BE /* LoadQueryFromStoreTests.swift */; }; - 9FA6ABCF1EC0A9F7000017BE /* StarWarsServerCachingRoundtripTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC81EC0A9F7000017BE /* StarWarsServerCachingRoundtripTests.swift */; }; - 9FA6ABD01EC0A9F7000017BE /* StarWarsServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC91EC0A9F7000017BE /* StarWarsServerTests.swift */; }; 9FA6ABD21EC0A9F7000017BE /* WatchQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABCB1EC0A9F7000017BE /* WatchQueryTests.swift */; }; 9FA6ABD51EC0AA49000017BE /* StarWarsAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FCE2CFA1E6C213D00E34457 /* StarWarsAPI.framework */; }; 9FA6ABD61EC0AA4D000017BE /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; }; @@ -291,6 +289,9 @@ DE6B15B126152BE10068D642 /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; }; DED45C182615308E0086EF63 /* TestServerURLs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45C172615308E0086EF63 /* TestServerURLs.swift */; }; DED45C2A2615319E0086EF63 /* LegacyInterceptorProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45C292615319E0086EF63 /* LegacyInterceptorProviderTests.swift */; }; + DED45D73261675890086EF63 /* StarWarsServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC91EC0A9F7000017BE /* StarWarsServerTests.swift */; }; + DED45D852616759C0086EF63 /* TestConfigs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45D842616759C0086EF63 /* TestConfigs.swift */; }; + DED45D9626167F020086EF63 /* StarWarsServerCachingRoundtripTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC81EC0A9F7000017BE /* StarWarsServerCachingRoundtripTests.swift */; }; E86D8E05214B32FD0028EFE1 /* JSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86D8E03214B32DA0028EFE1 /* JSONTests.swift */; }; F16D083C21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */; }; F82E62E122BCD223000C311B /* AutomaticPersistedQueriesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */; }; @@ -928,6 +929,7 @@ DEA34AF6260E821F00F95F86 /* Apollo-Target-AnimalKingdomAPI.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-AnimalKingdomAPI.xcconfig"; sourceTree = ""; }; DED45C172615308E0086EF63 /* TestServerURLs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestServerURLs.swift; sourceTree = ""; }; DED45C292615319E0086EF63 /* LegacyInterceptorProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyInterceptorProviderTests.swift; sourceTree = ""; }; + DED45D842616759C0086EF63 /* TestConfigs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestConfigs.swift; sourceTree = ""; }; E86D8E03214B32DA0028EFE1 /* JSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONTests.swift; sourceTree = ""; }; F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueryFromJSONBuildingTests.swift; sourceTree = ""; }; F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutomaticPersistedQueriesTests.swift; sourceTree = ""; }; @@ -1688,8 +1690,6 @@ children = ( 9BB4F5B12581AA50004F0BD6 /* CacheDependentInterceptorTests.swift */, 9FA6ABC51EC0A9F7000017BE /* FetchQueryTests.swift */, - 9FA6ABC81EC0A9F7000017BE /* StarWarsServerCachingRoundtripTests.swift */, - 9FA6ABC91EC0A9F7000017BE /* StarWarsServerTests.swift */, 9FA6ABC61EC0A9F7000017BE /* LoadQueryFromStoreTests.swift */, 9F8622F71EC2004200C38162 /* ReadWriteFromStoreTests.swift */, 9B60204E23FDFA9F00D0C8E0 /* SQLiteCacheTests.swift */, @@ -1954,8 +1954,10 @@ DE6B15AD26152BE10068D642 /* ApolloServerIntegrationTests */ = { isa = PBXGroup; children = ( + DED45D62261675620086EF63 /* TestHelpers */, DE6B15AE26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift */, - DED45C172615308E0086EF63 /* TestServerURLs.swift */, + 9FA6ABC91EC0A9F7000017BE /* StarWarsServerTests.swift */, + 9FA6ABC81EC0A9F7000017BE /* StarWarsServerCachingRoundtripTests.swift */, DE6B15B026152BE10068D642 /* Info.plist */, ); path = ApolloServerIntegrationTests; @@ -1989,6 +1991,15 @@ path = Configuration/Shared; sourceTree = SOURCE_ROOT; }; + DED45D62261675620086EF63 /* TestHelpers */ = { + isa = PBXGroup; + children = ( + DED45C172615308E0086EF63 /* TestServerURLs.swift */, + DED45D842616759C0086EF63 /* TestConfigs.swift */, + ); + path = TestHelpers; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -2940,10 +2951,8 @@ 9FD03C2E25527CE7002227DC /* StoreConcurrencyTests.swift in Sources */, 9F39101725493DDC00AF54A6 /* FetchQueryTests.swift in Sources */, 9FA6ABCD1EC0A9F7000017BE /* LoadQueryFromStoreTests.swift in Sources */, - 9FA6ABCF1EC0A9F7000017BE /* StarWarsServerCachingRoundtripTests.swift in Sources */, 9FA6ABD21EC0A9F7000017BE /* WatchQueryTests.swift in Sources */, 9B60204F23FDFA9F00D0C8E0 /* SQLiteCacheTests.swift in Sources */, - 9FA6ABD01EC0A9F7000017BE /* StarWarsServerTests.swift in Sources */, 9F8622F81EC2004200C38162 /* ReadWriteFromStoreTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -3088,7 +3097,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + DED45D852616759C0086EF63 /* TestConfigs.swift in Sources */, + DED45D9626167F020086EF63 /* StarWarsServerCachingRoundtripTests.swift in Sources */, DE6B15AF26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift in Sources */, + DED45D73261675890086EF63 /* StarWarsServerTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift b/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift index 944a42f8c6..00bcf152b9 100644 --- a/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift +++ b/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift @@ -16,30 +16,6 @@ class SQLiteLoadQueryFromStoreTests: LoadQueryFromStoreTests { } } -class SQLiteStarWarsServerCachingRoundtripTests: StarWarsServerCachingRoundtripTests { - override var cacheType: TestCacheProvider.Type { - SQLiteTestCacheProvider.self - } -} - -class SQLiteStarWarsServerAPQsGetMethodTests: StarWarsServerAPQsGetMethodTests { - override var cacheType: TestCacheProvider.Type { - SQLiteTestCacheProvider.self - } -} - -class SQLiteStarWarsServerAPQsTests: StarWarsServerAPQsTests { - override var cacheType: TestCacheProvider.Type { - SQLiteTestCacheProvider.self - } -} - -class SQLiteStarWarsServerTests: StarWarsServerTests { - override var cacheType: TestCacheProvider.Type { - SQLiteTestCacheProvider.self - } -} - class SQLiteReadWriteFromStoreTests: ReadWriteFromStoreTests { override var cacheType: TestCacheProvider.Type { SQLiteTestCacheProvider.self diff --git a/Tests/ApolloCacheDependentTests/StarWarsServerCachingRoundtripTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift similarity index 94% rename from Tests/ApolloCacheDependentTests/StarWarsServerCachingRoundtripTests.swift rename to Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift index 0b7b0c1f52..51a36d9bc9 100644 --- a/Tests/ApolloCacheDependentTests/StarWarsServerCachingRoundtripTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift @@ -1,8 +1,15 @@ import XCTest @testable import Apollo import ApolloTestSupport +import ApolloSQLiteTestSupport import StarWarsAPI +class SQLiteStarWarsServerCachingRoundtripTests: StarWarsServerCachingRoundtripTests { + override var cacheType: TestCacheProvider.Type { + SQLiteTestCacheProvider.self + } +} + class StarWarsServerCachingRoundtripTests: XCTestCase, CacheDependentTesting { var cacheType: TestCacheProvider.Type { InMemoryTestCacheProvider.self diff --git a/Tests/ApolloCacheDependentTests/StarWarsServerTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift similarity index 88% rename from Tests/ApolloCacheDependentTests/StarWarsServerTests.swift rename to Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift index b2f766269e..7f054d30fb 100644 --- a/Tests/ApolloCacheDependentTests/StarWarsServerTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift @@ -1,71 +1,42 @@ import XCTest @testable import Apollo import ApolloTestSupport +import ApolloSQLiteTestSupport import StarWarsAPI - -protocol TestConfig { - func network(store: ApolloStore) -> NetworkTransport -} - -class DefaultConfig: TestConfig { - - func transport(with store: ApolloStore) -> NetworkTransport { - let provider = LegacyInterceptorProvider(store: store) - return RequestChainNetworkTransport(interceptorProvider: provider, - endpointURL: TestURL.starWarsServer.url) - } - - func network(store: ApolloStore) -> NetworkTransport { - return transport(with: store) +class StarWarsServerAPQsGetMethodTests: StarWarsServerTests { + override func setUp() { + super.setUp() + config = APQsWithGetMethodConfig() } } -class APQsConfig: TestConfig { - - func transport(with store: ApolloStore) -> NetworkTransport { - let provider = LegacyInterceptorProvider(store: store) - return RequestChainNetworkTransport(interceptorProvider: provider, - endpointURL: TestURL.starWarsServer.url, - autoPersistQueries: true) - } - - func network(store: ApolloStore) -> NetworkTransport { - return transport(with: store) +class StarWarsServerAPQsTests: StarWarsServerTests { + override func setUp() { + super.setUp() + config = APQsConfig() } } -class APQsWithGetMethodConfig: TestConfig { - - func transport(with store: ApolloStore) -> NetworkTransport { - let provider = LegacyInterceptorProvider(store: store) - return RequestChainNetworkTransport(interceptorProvider: provider, - endpointURL: TestURL.starWarsServer.url, - autoPersistQueries: true, - useGETForPersistedQueryRetry: true) - } - - func network(store: ApolloStore) -> NetworkTransport { - return transport(with: store) +class SQLiteStarWarsServerAPQsGetMethodTests: StarWarsServerAPQsGetMethodTests { + override var cacheType: TestCacheProvider.Type { + SQLiteTestCacheProvider.self } } -class StarWarsServerAPQsGetMethodTests: StarWarsServerTests { - override func setUp() { - super.setUp() - config = APQsWithGetMethodConfig() +class SQLiteStarWarsServerAPQsTests: StarWarsServerAPQsTests { + override var cacheType: TestCacheProvider.Type { + SQLiteTestCacheProvider.self } } -class StarWarsServerAPQsTests: StarWarsServerTests { - override func setUp() { - super.setUp() - config = APQsConfig() +class SQLiteStarWarsServerTests: StarWarsServerTests { + override var cacheType: TestCacheProvider.Type { + SQLiteTestCacheProvider.self } } class StarWarsServerTests: XCTestCase, CacheDependentTesting { - // MARK: Queries var config: TestConfig! var cacheType: TestCacheProvider.Type { @@ -94,6 +65,8 @@ class StarWarsServerTests: XCTestCase, CacheDependentTesting { try super.tearDownWithError() } + + // MARK: Queries func testHeroNameQuery() { fetch(query: HeroNameQuery()) { data in diff --git a/Tests/ApolloServerIntegrationTests/TestHelpers/TestConfigs.swift b/Tests/ApolloServerIntegrationTests/TestHelpers/TestConfigs.swift new file mode 100644 index 0000000000..8b04e4dfe2 --- /dev/null +++ b/Tests/ApolloServerIntegrationTests/TestHelpers/TestConfigs.swift @@ -0,0 +1,47 @@ +@testable import Apollo + +protocol TestConfig { + func network(store: ApolloStore) -> NetworkTransport +} + +class DefaultConfig: TestConfig { + + func transport(with store: ApolloStore) -> NetworkTransport { + let provider = LegacyInterceptorProvider(store: store) + return RequestChainNetworkTransport(interceptorProvider: provider, + endpointURL: TestServerURL.starWarsServer.url) + } + + func network(store: ApolloStore) -> NetworkTransport { + return transport(with: store) + } +} + +class APQsConfig: TestConfig { + + func transport(with store: ApolloStore) -> NetworkTransport { + let provider = LegacyInterceptorProvider(store: store) + return RequestChainNetworkTransport(interceptorProvider: provider, + endpointURL: TestServerURL.starWarsServer.url, + autoPersistQueries: true) + } + + func network(store: ApolloStore) -> NetworkTransport { + return transport(with: store) + } +} + +class APQsWithGetMethodConfig: TestConfig { + + func transport(with store: ApolloStore) -> NetworkTransport { + let provider = LegacyInterceptorProvider(store: store) + return RequestChainNetworkTransport(interceptorProvider: provider, + endpointURL: TestServerURL.starWarsServer.url, + autoPersistQueries: true, + useGETForPersistedQueryRetry: true) + } + + func network(store: ApolloStore) -> NetworkTransport { + return transport(with: store) + } +} diff --git a/Tests/ApolloServerIntegrationTests/TestServerURLs.swift b/Tests/ApolloServerIntegrationTests/TestHelpers/TestServerURLs.swift similarity index 100% rename from Tests/ApolloServerIntegrationTests/TestServerURLs.swift rename to Tests/ApolloServerIntegrationTests/TestHelpers/TestServerURLs.swift From 8b0273b52eb403b3a8a392ab3eb7f4339f661c1d Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 6 Apr 2021 11:19:12 -0700 Subject: [PATCH 05/30] Moved all server dependent tests out of unit tests. Consolidated unit test targets --- Apollo.xcodeproj/project.pbxproj | 713 ++++-------------- .../xcshareddata/xcschemes/Apollo.xcscheme | 8 +- .../xcschemes/ApolloWebSocket.xcscheme | 8 +- .../ApolloSQLiteTestSupport.h | 11 - Sources/ApolloSQLiteTestSupport/Info.plist | 24 - .../SQLiteTestCacheProvider.swift} | 1 - Tests/Apollo-IntegrationTestPlan.xctestplan | 26 + ...estplan => Apollo-UnitTestPlan.xctestplan} | 2 +- Tests/ApolloCacheDependentTests/Info.plist | 22 - Tests/ApolloSQLiteTests/Info.plist | 22 - .../StarWarsSubscriptionTests.swift | 0 .../StarWarsWebSocketTests.swift | 0 .../URLSessionClientTests.swift | 0 .../UploadTests.swift | 275 ++----- .../CacheDependentInterceptorTests.swift | 0 .../Cache}/FetchQueryTests.swift | 0 .../Cache}/LoadQueryFromStoreTests.swift | 0 .../Cache}/ReadWriteFromStoreTests.swift | 0 .../Cache/SQLite}/CachePersistenceTests.swift | 1 - .../Cache/SQLite}/SQLiteCacheTests.swift | 1 - .../Cache}/StoreConcurrencyTests.swift | 0 .../Cache}/WatchQueryTests.swift | 0 Tests/ApolloTests/UploadRequestTests.swift | 181 +++++ .../WebSocket}/MockWebSocket.swift | 0 .../SplitNetworkTransportTests.swift | 0 .../WebSocket/WebSocketTests.swift} | 2 +- .../WebSocket}/WebSocketTransportTests.swift | 0 Tests/ApolloWebSocket-UnitTestPlan.xctestplan | 33 + Tests/ApolloWebsocketTests/Info.plist | 28 - 29 files changed, 442 insertions(+), 916 deletions(-) delete mode 100644 Sources/ApolloSQLiteTestSupport/ApolloSQLiteTestSupport.h delete mode 100644 Sources/ApolloSQLiteTestSupport/Info.plist rename Sources/{ApolloSQLiteTestSupport/TestCacheProvider.swift => ApolloTestSupport/SQLiteTestCacheProvider.swift} (98%) create mode 100644 Tests/Apollo-IntegrationTestPlan.xctestplan rename Tests/{ApolloCacheDependentTests/UnitTestPlan.xctestplan => Apollo-UnitTestPlan.xctestplan} (86%) delete mode 100644 Tests/ApolloCacheDependentTests/Info.plist delete mode 100644 Tests/ApolloSQLiteTests/Info.plist rename Tests/{ApolloWebsocketTests => ApolloServerIntegrationTests}/StarWarsSubscriptionTests.swift (100%) rename Tests/{ApolloWebsocketTests => ApolloServerIntegrationTests}/StarWarsWebSocketTests.swift (100%) rename Tests/{ApolloTests => ApolloServerIntegrationTests}/URLSessionClientTests.swift (100%) rename Tests/{ApolloTests => ApolloServerIntegrationTests}/UploadTests.swift (59%) rename Tests/{ApolloCacheDependentTests => ApolloTests/Cache}/CacheDependentInterceptorTests.swift (100%) rename Tests/{ApolloCacheDependentTests => ApolloTests/Cache}/FetchQueryTests.swift (100%) rename Tests/{ApolloCacheDependentTests => ApolloTests/Cache}/LoadQueryFromStoreTests.swift (100%) rename Tests/{ApolloCacheDependentTests => ApolloTests/Cache}/ReadWriteFromStoreTests.swift (100%) rename Tests/{ApolloSQLiteTests => ApolloTests/Cache/SQLite}/CachePersistenceTests.swift (99%) rename Tests/{ApolloCacheDependentTests => ApolloTests/Cache/SQLite}/SQLiteCacheTests.swift (95%) rename Tests/{ApolloCacheDependentTests => ApolloTests/Cache}/StoreConcurrencyTests.swift (100%) rename Tests/{ApolloCacheDependentTests => ApolloTests/Cache}/WatchQueryTests.swift (100%) create mode 100644 Tests/ApolloTests/UploadRequestTests.swift rename Tests/{ApolloWebsocketTests => ApolloTests/WebSocket}/MockWebSocket.swift (100%) rename Tests/{ApolloWebsocketTests => ApolloTests/WebSocket}/SplitNetworkTransportTests.swift (100%) rename Tests/{ApolloWebsocketTests/MockWebSocketTests.swift => ApolloTests/WebSocket/WebSocketTests.swift} (98%) rename Tests/{ApolloWebsocketTests => ApolloTests/WebSocket}/WebSocketTransportTests.swift (100%) create mode 100644 Tests/ApolloWebSocket-UnitTestPlan.xctestplan delete mode 100644 Tests/ApolloWebsocketTests/Info.plist diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index fa3f7ee43f..36e5850a8d 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -65,7 +65,6 @@ 9B4751AD2575B5070001FB87 /* PluralizerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4751AC2575B5070001FB87 /* PluralizerTests.swift */; }; 9B4F453F244A27B900C2CF7D /* URLSessionClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F453E244A27B900C2CF7D /* URLSessionClient.swift */; }; 9B4F4541244A2A9200C2CF7D /* HTTPBinAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F4540244A2A9200C2CF7D /* HTTPBinAPI.swift */; }; - 9B4F4543244A2AD300C2CF7D /* URLSessionClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F4542244A2AD300C2CF7D /* URLSessionClientTests.swift */; }; 9B518C87235F819E004C426D /* CLIDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B518C85235F8125004C426D /* CLIDownloader.swift */; }; 9B518C8C235F8B5F004C426D /* ApolloFilePathHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B518C8A235F8B05004C426D /* ApolloFilePathHelper.swift */; }; 9B518C8D235F8B9E004C426D /* CLIDownloaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B518C88235F8AD4004C426D /* CLIDownloaderTests.swift */; }; @@ -74,8 +73,6 @@ 9B5A1EFD24352AC100F066BB /* ExpectedReviewInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B68F06C241C646700E97318 /* ExpectedReviewInput.swift */; }; 9B5A1EFE24352AED00F066BB /* ExpectedColorInput.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B68F06A241C643000E97318 /* ExpectedColorInput.swift */; }; 9B5A1F002435356400F066BB /* ExpectedColorInputNoModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B5A1EFF2435356400F066BB /* ExpectedColorInputNoModifier.swift */; }; - 9B60204D23FDF4B700D0C8E0 /* ApolloSQLiteTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDAE223FDED8000ACD198 /* ApolloSQLiteTestSupport.framework */; }; - 9B60204F23FDFA9F00D0C8E0 /* SQLiteCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B60204E23FDFA9F00D0C8E0 /* SQLiteCacheTests.swift */; }; 9B64F6762354D219002D1BB5 /* URL+QueryDict.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B64F6752354D219002D1BB5 /* URL+QueryDict.swift */; }; 9B6835342460B47900337AE6 /* ASTVariableType+TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6835322460B32A00337AE6 /* ASTVariableType+TestHelpers.swift */; }; 9B683538246310D400337AE6 /* ExpectedReviewInputNoModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B683537246310D400337AE6 /* ExpectedReviewInputNoModifier.swift */; }; @@ -99,11 +96,6 @@ 9B7B6F59233C287200F32205 /* ApolloCodegen.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B6F57233C287100F32205 /* ApolloCodegen.swift */; }; 9B7B6F5A233C287200F32205 /* ApolloCodegenOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B6F58233C287100F32205 /* ApolloCodegenOptions.swift */; }; 9B7B6F69233C2C0C00F32205 /* FileManager+Apollo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7B6F68233C2C0C00F32205 /* FileManager+Apollo.swift */; }; - 9B7BDA8D23FDE92A00ACD198 /* MockWebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8723FDE92900ACD198 /* MockWebSocket.swift */; }; - 9B7BDA8E23FDE92A00ACD198 /* StarWarsSubscriptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8823FDE92900ACD198 /* StarWarsSubscriptionTests.swift */; }; - 9B7BDA8F23FDE92A00ACD198 /* MockWebSocketTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8923FDE92900ACD198 /* MockWebSocketTests.swift */; }; - 9B7BDA9023FDE92A00ACD198 /* SplitNetworkTransportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8A23FDE92900ACD198 /* SplitNetworkTransportTests.swift */; }; - 9B7BDA9223FDE92A00ACD198 /* StarWarsWebSocketTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8C23FDE92900ACD198 /* StarWarsWebSocketTests.swift */; }; 9B7BDA9B23FDE94C00ACD198 /* WebSocketError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA9423FDE94C00ACD198 /* WebSocketError.swift */; }; 9B7BDA9C23FDE94C00ACD198 /* WebSocketTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA9523FDE94C00ACD198 /* WebSocketTask.swift */; }; 9B7BDA9D23FDE94C00ACD198 /* SplitNetworkTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA9623FDE94C00ACD198 /* SplitNetworkTransport.swift */; }; @@ -113,19 +105,9 @@ 9B7BDAAC23FDEA7B00ACD198 /* Starscream in Frameworks */ = {isa = PBXBuildFile; productRef = 9B7BDAAB23FDEA7B00ACD198 /* Starscream */; }; 9B7BDAD023FDEBE300ACD198 /* SQLiteSerialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDACD23FDEBE300ACD198 /* SQLiteSerialization.swift */; }; 9B7BDAD223FDEBE300ACD198 /* SQLiteNormalizedCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDACF23FDEBE300ACD198 /* SQLiteNormalizedCache.swift */; }; - 9B7BDAD623FDEC9B00ACD198 /* CachePersistenceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDAD423FDEC9B00ACD198 /* CachePersistenceTests.swift */; }; - 9B7BDAEF23FDED9700ACD198 /* TestCacheProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDAEC23FDED9700ACD198 /* TestCacheProvider.swift */; }; - 9B7BDAF023FDED9700ACD198 /* ApolloSQLiteTestSupport.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B7BDAED23FDED9700ACD198 /* ApolloSQLiteTestSupport.h */; settings = {ATTRIBUTES = (Public, ); }; }; 9B7BDAF623FDEE2600ACD198 /* SQLite in Frameworks */ = {isa = PBXBuildFile; productRef = 9B7BDAF523FDEE2600ACD198 /* SQLite */; }; 9B7BDAFA23FDEE8A00ACD198 /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; }; 9B7BDAFD23FDEE9300ACD198 /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; }; - 9B7BDB0423FDF02200ACD198 /* StarWarsAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FCE2CFA1E6C213D00E34457 /* StarWarsAPI.framework */; }; - 9B7BDB0523FDF02600ACD198 /* ApolloWebSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDA7D23FDE90400ACD198 /* ApolloWebSocket.framework */; }; - 9B7BDB0823FDF04400ACD198 /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; }; - 9B7BDB1423FDF09600ACD198 /* ApolloSQLiteTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDAE223FDED8000ACD198 /* ApolloSQLiteTestSupport.framework */; }; - 9B7BDB1523FDF09600ACD198 /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; }; - 9B7BDB1A23FDF12000ACD198 /* ApolloSQLite.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDABF23FDEBB600ACD198 /* ApolloSQLite.framework */; }; - 9B7BDB1D23FDF22300ACD198 /* StarWarsAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FCE2CFA1E6C213D00E34457 /* StarWarsAPI.framework */; }; 9B8C3FB3248DA2FE00707B13 /* URL+Apollo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B8C3FB1248DA2EA00707B13 /* URL+Apollo.swift */; }; 9B8C3FB5248DA3E000707B13 /* URLExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B8C3FB4248DA3E000707B13 /* URLExtensionsTests.swift */; }; 9B95EDC022CAA0B000702BB2 /* GETTransformerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B95EDBF22CAA0AF00702BB2 /* GETTransformerTests.swift */; }; @@ -133,12 +115,11 @@ 9B96500C24BE7239003C29C0 /* LegacyCacheReadInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B96500B24BE7239003C29C0 /* LegacyCacheReadInterceptor.swift */; }; 9B9BBAF324DB39D70021C30F /* UploadRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B9BBAF224DB39D70021C30F /* UploadRequest.swift */; }; 9B9BBAF524DB4F890021C30F /* AutomaticPersistedQueryInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B9BBAF424DB4F890021C30F /* AutomaticPersistedQueryInterceptor.swift */; }; - 9B9BBB1C24DB760B0021C30F /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B9BBB1A24DB75E60021C30F /* UploadTests.swift */; }; + 9B9BBB1C24DB760B0021C30F /* UploadRequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B9BBB1A24DB75E60021C30F /* UploadRequestTests.swift */; }; 9B9F16A726013DAB00FB2F31 /* SQLiteDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B9F16A626013DAB00FB2F31 /* SQLiteDatabase.swift */; }; 9B9F16B82601532500FB2F31 /* SQLiteDotSwiftDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B9F16B72601532500FB2F31 /* SQLiteDotSwiftDatabase.swift */; }; 9BA1244A22D8A8EA00BF1D24 /* JSONSerialization+Sorting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA1244922D8A8EA00BF1D24 /* JSONSerialization+Sorting.swift */; }; 9BA3130E2302BEA5007B7FC5 /* DispatchQueue+Optional.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA3130D2302BEA5007B7FC5 /* DispatchQueue+Optional.swift */; }; - 9BAD16B923FE362600007BEF /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; }; 9BAEEBEE2346644600808306 /* ApolloSchemaOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAEEBED2346644600808306 /* ApolloSchemaOptions.swift */; }; 9BAEEBEF2346644B00808306 /* ApolloSchemaDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAEEBEB234663F200808306 /* ApolloSchemaDownloader.swift */; }; 9BAEEBF123467E0A00808306 /* ApolloCLI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAEEBF023467E0A00808306 /* ApolloCLI.swift */; }; @@ -151,7 +132,6 @@ 9BAEEC15234C132600808306 /* CLIExtractorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAEEC14234C132600808306 /* CLIExtractorTests.swift */; }; 9BAEEC17234C275600808306 /* ApolloSchemaTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAEEC16234C275600808306 /* ApolloSchemaTests.swift */; }; 9BAEEC19234C297800808306 /* ApolloCodegenTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BAEEC18234C297800808306 /* ApolloCodegenTests.swift */; }; - 9BB4F5B22581AA50004F0BD6 /* CacheDependentInterceptorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BB4F5B12581AA50004F0BD6 /* CacheDependentInterceptorTests.swift */; }; 9BC139A424EDCA6C00876D29 /* InterceptorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BC139A224EDCA4400876D29 /* InterceptorTests.swift */; }; 9BC139A624EDCAD900876D29 /* BlindRetryingTestInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BC139A524EDCAD900876D29 /* BlindRetryingTestInterceptor.swift */; }; 9BC139A824EDCE4F00876D29 /* RetryToCountThenSucceedInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BC139A724EDCE4F00876D29 /* RetryToCountThenSucceedInterceptor.swift */; }; @@ -199,7 +179,6 @@ 9F27D4641D40379500715680 /* JSONStandardTypeConversions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F27D4631D40379500715680 /* JSONStandardTypeConversions.swift */; }; 9F295E311E27534800A24949 /* NormalizeQueryResults.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F295E301E27534800A24949 /* NormalizeQueryResults.swift */; }; 9F295E381E277B2A00A24949 /* GraphQLResultNormalizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F295E371E277B2A00A24949 /* GraphQLResultNormalizer.swift */; }; - 9F39101725493DDC00AF54A6 /* FetchQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC51EC0A9F7000017BE /* FetchQueryTests.swift */; }; 9F3910272549741400AF54A6 /* MockGraphQLServer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F3910262549741400AF54A6 /* MockGraphQLServer.swift */; }; 9F41CBF025A3490600C02CB7 /* schema.graphqls in Resources */ = {isa = PBXBuildFile; fileRef = 9F41CBEF25A3490600C02CB7 /* schema.graphqls */; }; 9F41CC0025A3491E00C02CB7 /* schema.json in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061622591B3860020D1E0 /* schema.json */; }; @@ -223,20 +202,14 @@ 9F68F9F125415827004F26D0 /* XCTestCase+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F68F9F025415827004F26D0 /* XCTestCase+Helpers.swift */; }; 9F69FFA91D42855900E000B1 /* NetworkTransport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F69FFA81D42855900E000B1 /* NetworkTransport.swift */; }; 9F7BA89922927A3700999B3B /* ResponsePath.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F7BA89822927A3700999B3B /* ResponsePath.swift */; }; - 9F8622F81EC2004200C38162 /* ReadWriteFromStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8622F71EC2004200C38162 /* ReadWriteFromStoreTests.swift */; }; 9F8622FA1EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8622F91EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift */; }; 9F86B68B1E6438D700B885FF /* GraphQLSelectionSetMapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F86B68A1E6438D700B885FF /* GraphQLSelectionSetMapper.swift */; }; 9F86B6901E65533D00B885FF /* GraphQLResponseGenerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F86B68F1E65533D00B885FF /* GraphQLResponseGenerator.swift */; }; 9F8A958D1EC0FFAB00304A2D /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; }; - 9F8A95901EC0FFC100304A2D /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; }; 9F8E0BD325668552000D9FA5 /* DataLoader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FADC84E1E6B865E00C677E6 /* DataLoader.swift */; }; 9F8E0BE325668559000D9FA5 /* PossiblyDeferred.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F33D6A32566475600A1543F /* PossiblyDeferred.swift */; }; 9F8F334C229044A200C0E83B /* Decoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8F334B229044A200C0E83B /* Decoding.swift */; }; 9F91CF8F1F6C0DB2008DD0BE /* MutatingResultsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F91CF8E1F6C0DB2008DD0BE /* MutatingResultsTests.swift */; }; - 9FA6ABCD1EC0A9F7000017BE /* LoadQueryFromStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC61EC0A9F7000017BE /* LoadQueryFromStoreTests.swift */; }; - 9FA6ABD21EC0A9F7000017BE /* WatchQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABCB1EC0A9F7000017BE /* WatchQueryTests.swift */; }; - 9FA6ABD51EC0AA49000017BE /* StarWarsAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FCE2CFA1E6C213D00E34457 /* StarWarsAPI.framework */; }; - 9FA6ABD61EC0AA4D000017BE /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; }; 9FA6F3681E65DF4700BF8D73 /* GraphQLResultAccumulator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6F3671E65DF4700BF8D73 /* GraphQLResultAccumulator.swift */; }; 9FACA9BE1F42E67200AE2DBD /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; }; 9FBE0D4025407B64002ED0B1 /* AsyncResultObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FBE0D3F25407B64002ED0B1 /* AsyncResultObserver.swift */; }; @@ -256,7 +229,6 @@ 9FCDFD291E33D0CE007519DC /* GraphQLQueryWatcher.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FCDFD281E33D0CE007519DC /* GraphQLQueryWatcher.swift */; }; 9FCE2CEE1E6BE2D900E34457 /* NormalizedCache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FCE2CED1E6BE2D800E34457 /* NormalizedCache.swift */; }; 9FCE2D091E6C254700E34457 /* StarWarsAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FCE2CFA1E6C213D00E34457 /* StarWarsAPI.framework */; }; - 9FD03C2E25527CE7002227DC /* StoreConcurrencyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FD03C2D25527CE6002227DC /* StoreConcurrencyTests.swift */; }; 9FD1519A255D7F30003BDAAA /* IssuesAndCommentsForRepository.json in Resources */ = {isa = PBXBuildFile; fileRef = 9FD15199255D7F30003BDAAA /* IssuesAndCommentsForRepository.json */; }; 9FDE0731258F3AA100DC0CA5 /* SchemaLoadingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F1A96AF258F36B200A06EEB /* SchemaLoadingTests.swift */; }; 9FDE0752258F3BC200DC0CA5 /* StarWarsAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FCE2CFA1E6C213D00E34457 /* StarWarsAPI.framework */; }; @@ -272,7 +244,6 @@ C377CCA922D798BD00572E03 /* GraphQLFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = C377CCA822D798BD00572E03 /* GraphQLFile.swift */; }; C377CCAB22D7992E00572E03 /* MultipartFormData.swift in Sources */ = {isa = PBXBuildFile; fileRef = C377CCAA22D7992E00572E03 /* MultipartFormData.swift */; }; D87AC09F2564D60B0079FAA5 /* ApolloClientOperationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D87AC09E2564D60B0079FAA5 /* ApolloClientOperationTests.swift */; }; - D90F1AFB2479E57A007A1534 /* WebSocketTransportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90F1AF92479DEE5007A1534 /* WebSocketTransportTests.swift */; }; DE3C7974260A646300D2F4FF /* dist in Resources */ = {isa = PBXBuildFile; fileRef = DE3C7973260A646300D2F4FF /* dist */; }; DE3C7A94260A6C1000D2F4FF /* ApolloCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B68353E2463481A00337AE6 /* ApolloCore.framework */; }; DE3C7A95260A6C1000D2F4FF /* ApolloCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9B68353E2463481A00337AE6 /* ApolloCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; @@ -292,6 +263,25 @@ DED45D73261675890086EF63 /* StarWarsServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC91EC0A9F7000017BE /* StarWarsServerTests.swift */; }; DED45D852616759C0086EF63 /* TestConfigs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45D842616759C0086EF63 /* TestConfigs.swift */; }; DED45D9626167F020086EF63 /* StarWarsServerCachingRoundtripTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC81EC0A9F7000017BE /* StarWarsServerCachingRoundtripTests.swift */; }; + DED45DE9261B96B70086EF63 /* LoadQueryFromStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC61EC0A9F7000017BE /* LoadQueryFromStoreTests.swift */; }; + DED45DEA261B96B70086EF63 /* WatchQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABCB1EC0A9F7000017BE /* WatchQueryTests.swift */; }; + DED45DEB261B96B70086EF63 /* SQLiteCacheTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B60204E23FDFA9F00D0C8E0 /* SQLiteCacheTests.swift */; }; + DED45DEC261B96B70086EF63 /* CacheDependentInterceptorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BB4F5B12581AA50004F0BD6 /* CacheDependentInterceptorTests.swift */; }; + DED45DED261B96B70086EF63 /* StoreConcurrencyTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FD03C2D25527CE6002227DC /* StoreConcurrencyTests.swift */; }; + DED45DEE261B96B70086EF63 /* FetchQueryTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC51EC0A9F7000017BE /* FetchQueryTests.swift */; }; + DED45DEF261B96B70086EF63 /* ReadWriteFromStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9F8622F71EC2004200C38162 /* ReadWriteFromStoreTests.swift */; }; + DED45E30261B972C0086EF63 /* CachePersistenceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDAD423FDEC9B00ACD198 /* CachePersistenceTests.swift */; }; + DED45E6B261B9EAC0086EF63 /* SQLiteTestCacheProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDAEC23FDED9700ACD198 /* SQLiteTestCacheProvider.swift */; }; + DED45EC3261BA0ED0086EF63 /* WebSocketTransportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90F1AF92479DEE5007A1534 /* WebSocketTransportTests.swift */; }; + DED45EC4261BA0ED0086EF63 /* SplitNetworkTransportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8A23FDE92900ACD198 /* SplitNetworkTransportTests.swift */; }; + DED45EC5261BA0ED0086EF63 /* MockWebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8723FDE92900ACD198 /* MockWebSocket.swift */; }; + DED45EC7261BA0ED0086EF63 /* WebSocketTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8923FDE92900ACD198 /* WebSocketTests.swift */; }; + DED45EE4261BA1FB0086EF63 /* ApolloSQLite.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDABF23FDEBB600ACD198 /* ApolloSQLite.framework */; }; + DED45EE5261BA1FB0086EF63 /* ApolloWebSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDA7D23FDE90400ACD198 /* ApolloWebSocket.framework */; }; + DED45EFE261CDA2A0086EF63 /* StarWarsSubscriptionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8823FDE92900ACD198 /* StarWarsSubscriptionTests.swift */; }; + DED45F17261CDA360086EF63 /* StarWarsWebSocketTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8C23FDE92900ACD198 /* StarWarsWebSocketTests.swift */; }; + DED45F30261CDB560086EF63 /* URLSessionClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F4542244A2AD300C2CF7D /* URLSessionClientTests.swift */; }; + DED45F4A261CDBFC0086EF63 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45F49261CDBFC0086EF63 /* UploadTests.swift */; }; E86D8E05214B32FD0028EFE1 /* JSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86D8E03214B32DA0028EFE1 /* JSONTests.swift */; }; F16D083C21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */; }; F82E62E122BCD223000C311B /* AutomaticPersistedQueriesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */; }; @@ -312,13 +302,6 @@ remoteGlobalIDString = 9B2DFBB524E1FA0D00ED3AE6; remoteInfo = UploadAPI; }; - 9B60204B23FDF4B300D0C8E0 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9B7BDAE123FDED8000ACD198; - remoteInfo = ApolloSQLiteTestSupport; - }; 9B683548246348CB00337AE6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; @@ -347,55 +330,6 @@ remoteGlobalIDString = 9FC750431D2A532C00458D91; remoteInfo = Apollo; }; - 9B7BDB0023FDF01600ACD198 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9B7BDA7C23FDE90400ACD198; - remoteInfo = ApolloWebSocket; - }; - 9B7BDB0223FDF01B00ACD198 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9FCE2CF91E6C213D00E34457; - remoteInfo = StarWarsAPI; - }; - 9B7BDB0623FDF04000ACD198 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9F8A95771EC0FC1200304A2D; - remoteInfo = ApolloTestSupport; - }; - 9B7BDB0F23FDF08F00ACD198 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9B7BDAE123FDED8000ACD198; - remoteInfo = ApolloSQLiteTestSupport; - }; - 9B7BDB1123FDF08F00ACD198 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9F8A95771EC0FC1200304A2D; - remoteInfo = ApolloTestSupport; - }; - 9B7BDB1823FDF11C00ACD198 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9B7BDABE23FDEBB600ACD198; - remoteInfo = ApolloSQLite; - }; - 9B7BDB1B23FDF22000ACD198 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9FCE2CF91E6C213D00E34457; - remoteInfo = StarWarsAPI; - }; 9B8C3FBB248DAA0400707B13 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; @@ -403,13 +337,6 @@ remoteGlobalIDString = 9B68353D2463481A00337AE6; remoteInfo = ApolloCore; }; - 9BAD16B723FE361F00007BEF /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9F8A95771EC0FC1200304A2D; - remoteInfo = ApolloTestSupport; - }; 9BAEEC02234BB8FD00808306 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; @@ -459,13 +386,6 @@ remoteGlobalIDString = 9F8A95771EC0FC1200304A2D; remoteInfo = ApolloTestSupport; }; - 9F8A958E1EC0FFB800304A2D /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9F8A95771EC0FC1200304A2D; - remoteInfo = ApolloTestSupport; - }; 9FA5FBB51EC05CE900304A9D /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; @@ -473,20 +393,6 @@ remoteGlobalIDString = 9FC750431D2A532C00458D91; remoteInfo = Apollo; }; - 9FA6ABD31EC0AA42000017BE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9FCE2CF91E6C213D00E34457; - remoteInfo = StarWarsAPI; - }; - 9FA6ABD71EC0AA55000017BE /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9FC750431D2A532C00458D91; - remoteInfo = Apollo; - }; 9FACA9B91F42E67200AE2DBD /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; @@ -529,6 +435,20 @@ remoteGlobalIDString = 9FC750431D2A532C00458D91; remoteInfo = Apollo; }; + DED45E97261B9EFA0086EF63 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9B7BDABE23FDEBB600ACD198; + remoteInfo = ApolloSQLite; + }; + DED45E99261B9F000086EF63 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9B7BDA7C23FDE90400ACD198; + remoteInfo = ApolloWebSocket; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -695,13 +615,11 @@ 9B7B6F57233C287100F32205 /* ApolloCodegen.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApolloCodegen.swift; sourceTree = ""; }; 9B7B6F58233C287100F32205 /* ApolloCodegenOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApolloCodegenOptions.swift; sourceTree = ""; }; 9B7B6F68233C2C0C00F32205 /* FileManager+Apollo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FileManager+Apollo.swift"; sourceTree = ""; }; - 9B7BDA6F23FDE8F200ACD198 /* ApolloWebSocketTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ApolloWebSocketTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 9B7BDA7D23FDE90400ACD198 /* ApolloWebSocket.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ApolloWebSocket.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9B7BDA8723FDE92900ACD198 /* MockWebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockWebSocket.swift; sourceTree = ""; }; 9B7BDA8823FDE92900ACD198 /* StarWarsSubscriptionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StarWarsSubscriptionTests.swift; sourceTree = ""; }; - 9B7BDA8923FDE92900ACD198 /* MockWebSocketTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MockWebSocketTests.swift; sourceTree = ""; }; + 9B7BDA8923FDE92900ACD198 /* WebSocketTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocketTests.swift; sourceTree = ""; }; 9B7BDA8A23FDE92900ACD198 /* SplitNetworkTransportTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SplitNetworkTransportTests.swift; sourceTree = ""; }; - 9B7BDA8B23FDE92900ACD198 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9B7BDA8C23FDE92900ACD198 /* StarWarsWebSocketTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StarWarsWebSocketTests.swift; sourceTree = ""; }; 9B7BDA9423FDE94C00ACD198 /* WebSocketError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocketError.swift; sourceTree = ""; }; 9B7BDA9523FDE94C00ACD198 /* WebSocketTask.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocketTask.swift; sourceTree = ""; }; @@ -714,22 +632,17 @@ 9B7BDAA323FDE98C00ACD198 /* ApolloWebSocket-Project-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Project-Release.xcconfig"; sourceTree = ""; }; 9B7BDAA423FDE98C00ACD198 /* ApolloWebSocket-Target-Framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Target-Framework.xcconfig"; sourceTree = ""; }; 9B7BDAA523FDE98C00ACD198 /* ApolloWebSocket-Project-Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Project-Debug.xcconfig"; sourceTree = ""; }; - 9B7BDAB123FDEBA800ACD198 /* ApolloSQLiteTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ApolloSQLiteTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 9B7BDABF23FDEBB600ACD198 /* ApolloSQLite.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ApolloSQLite.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9B7BDACD23FDEBE300ACD198 /* SQLiteSerialization.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SQLiteSerialization.swift; sourceTree = ""; }; 9B7BDACE23FDEBE300ACD198 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9B7BDACF23FDEBE300ACD198 /* SQLiteNormalizedCache.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SQLiteNormalizedCache.swift; sourceTree = ""; }; 9B7BDAD423FDEC9B00ACD198 /* CachePersistenceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CachePersistenceTests.swift; sourceTree = ""; }; - 9B7BDAD523FDEC9B00ACD198 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9B7BDAD823FDECB300ACD198 /* ApolloSQLite-Target-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Target-Framework.xcconfig"; sourceTree = ""; }; 9B7BDAD923FDECB400ACD198 /* ApolloSQLite-Project-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Project-Debug.xcconfig"; sourceTree = ""; }; 9B7BDADA23FDECB400ACD198 /* ApolloSQLite-Target-Tests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Target-Tests.xcconfig"; sourceTree = ""; }; 9B7BDADB23FDECB400ACD198 /* ApolloSQLite-Target-TestSupport.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Target-TestSupport.xcconfig"; sourceTree = ""; }; 9B7BDADC23FDECB400ACD198 /* ApolloSQLite-Project-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Project-Release.xcconfig"; sourceTree = ""; }; - 9B7BDAE223FDED8000ACD198 /* ApolloSQLiteTestSupport.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ApolloSQLiteTestSupport.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 9B7BDAEC23FDED9700ACD198 /* TestCacheProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestCacheProvider.swift; sourceTree = ""; }; - 9B7BDAED23FDED9700ACD198 /* ApolloSQLiteTestSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApolloSQLiteTestSupport.h; sourceTree = ""; }; - 9B7BDAEE23FDED9700ACD198 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 9B7BDAEC23FDED9700ACD198 /* SQLiteTestCacheProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SQLiteTestCacheProvider.swift; sourceTree = ""; }; 9B8110A723A1995D00688AC4 /* .keep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .keep; sourceTree = ""; }; 9B8C3FB1248DA2EA00707B13 /* URL+Apollo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URL+Apollo.swift"; sourceTree = ""; }; 9B8C3FB4248DA3E000707B13 /* URLExtensionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLExtensionsTests.swift; sourceTree = ""; }; @@ -739,7 +652,7 @@ 9B9BBAF224DB39D70021C30F /* UploadRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadRequest.swift; sourceTree = ""; }; 9B9BBAF424DB4F890021C30F /* AutomaticPersistedQueryInterceptor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AutomaticPersistedQueryInterceptor.swift; sourceTree = ""; }; 9B9BBB1624DB74720021C30F /* Apollo-Target-UploadAPI.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "Apollo-Target-UploadAPI.xcconfig"; sourceTree = ""; }; - 9B9BBB1A24DB75E60021C30F /* UploadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadTests.swift; sourceTree = ""; }; + 9B9BBB1A24DB75E60021C30F /* UploadRequestTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadRequestTests.swift; sourceTree = ""; }; 9B9F16A626013DAB00FB2F31 /* SQLiteDatabase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SQLiteDatabase.swift; sourceTree = ""; }; 9B9F16B72601532500FB2F31 /* SQLiteDotSwiftDatabase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SQLiteDotSwiftDatabase.swift; sourceTree = ""; }; 9BA1244922D8A8EA00BF1D24 /* JSONSerialization+Sorting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "JSONSerialization+Sorting.swift"; sourceTree = ""; }; @@ -838,8 +751,6 @@ 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ApolloTestSupport.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9F8F334B229044A200C0E83B /* Decoding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Decoding.swift; sourceTree = ""; }; 9F91CF8E1F6C0DB2008DD0BE /* MutatingResultsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MutatingResultsTests.swift; sourceTree = ""; }; - 9FA6ABBC1EC0A988000017BE /* ApolloCacheDependentTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ApolloCacheDependentTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 9FA6ABC01EC0A988000017BE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9FA6ABC51EC0A9F7000017BE /* FetchQueryTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FetchQueryTests.swift; sourceTree = ""; }; 9FA6ABC61EC0A9F7000017BE /* LoadQueryFromStoreTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadQueryFromStoreTests.swift; sourceTree = ""; }; 9FA6ABC81EC0A9F7000017BE /* StarWarsServerCachingRoundtripTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StarWarsServerCachingRoundtripTests.swift; sourceTree = ""; }; @@ -901,7 +812,7 @@ DE3C7B14260A6FCA00D2F4FF /* GraphQLEnum.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphQLEnum.swift; sourceTree = ""; }; DE3C7B15260A6FCA00D2F4FF /* ScalarTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScalarTypes.swift; sourceTree = ""; }; DE6B154A261505450068D642 /* GraphQLMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphQLMap.swift; sourceTree = ""; }; - DE6B15892615294F0068D642 /* UnitTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; name = UnitTestPlan.xctestplan; path = ApolloCacheDependentTests/UnitTestPlan.xctestplan; sourceTree = ""; }; + DE6B15892615294F0068D642 /* ApolloWebSocket-UnitTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "ApolloWebSocket-UnitTestPlan.xctestplan"; sourceTree = ""; }; DE6B15AC26152BE10068D642 /* ApolloServerIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ApolloServerIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; DE6B15AE26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyInterceptorProviderIntegrationTests.swift; sourceTree = ""; }; DE6B15B026152BE10068D642 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -929,7 +840,10 @@ DEA34AF6260E821F00F95F86 /* Apollo-Target-AnimalKingdomAPI.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-AnimalKingdomAPI.xcconfig"; sourceTree = ""; }; DED45C172615308E0086EF63 /* TestServerURLs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestServerURLs.swift; sourceTree = ""; }; DED45C292615319E0086EF63 /* LegacyInterceptorProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyInterceptorProviderTests.swift; sourceTree = ""; }; + DED45C3B26165DD70086EF63 /* Apollo-IntegrationTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Apollo-IntegrationTestPlan.xctestplan"; sourceTree = ""; }; DED45D842616759C0086EF63 /* TestConfigs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestConfigs.swift; sourceTree = ""; }; + DED45DC7261682260086EF63 /* Apollo-UnitTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Apollo-UnitTestPlan.xctestplan"; sourceTree = ""; }; + DED45F49261CDBFC0086EF63 /* UploadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadTests.swift; sourceTree = ""; }; E86D8E03214B32DA0028EFE1 /* JSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONTests.swift; sourceTree = ""; }; F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueryFromJSONBuildingTests.swift; sourceTree = ""; }; F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutomaticPersistedQueriesTests.swift; sourceTree = ""; }; @@ -960,16 +874,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDA6C23FDE8F200ACD198 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9B7BDB0823FDF04400ACD198 /* ApolloTestSupport.framework in Frameworks */, - 9B7BDB0523FDF02600ACD198 /* ApolloWebSocket.framework in Frameworks */, - 9B7BDB0423FDF02200ACD198 /* StarWarsAPI.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9B7BDA7A23FDE90400ACD198 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -979,16 +883,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDAAE23FDEBA800ACD198 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9B7BDB1D23FDF22300ACD198 /* StarWarsAPI.framework in Frameworks */, - 9B7BDB1423FDF09600ACD198 /* ApolloSQLiteTestSupport.framework in Frameworks */, - 9B7BDB1523FDF09600ACD198 /* ApolloTestSupport.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9B7BDABC23FDEBB600ACD198 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -998,15 +892,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDADF23FDED8000ACD198 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9BAD16B923FE362600007BEF /* ApolloTestSupport.framework in Frameworks */, - 9B7BDB1A23FDF12000ACD198 /* ApolloSQLite.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9BAEEBF9234BB8FD00808306 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -1031,17 +916,8 @@ buildActionMask = 2147483647; files = ( 9F65B1211EC106F30090B25F /* Apollo.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 9FA6ABB91EC0A988000017BE /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 9B60204D23FDF4B700D0C8E0 /* ApolloSQLiteTestSupport.framework in Frameworks */, - 9FA6ABD61EC0AA4D000017BE /* Apollo.framework in Frameworks */, - 9F8A95901EC0FFC100304A2D /* ApolloTestSupport.framework in Frameworks */, - 9FA6ABD51EC0AA49000017BE /* StarWarsAPI.framework in Frameworks */, + DED45EE4261BA1FB0086EF63 /* ApolloSQLite.framework in Frameworks */, + DED45EE5261BA1FB0086EF63 /* ApolloWebSocket.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1404,20 +1280,6 @@ path = Sources/ApolloCodegenLib; sourceTree = ""; }; - 9B7BDA8623FDE92900ACD198 /* ApolloWebsocketTests */ = { - isa = PBXGroup; - children = ( - 9B7BDA8723FDE92900ACD198 /* MockWebSocket.swift */, - 9B7BDA8923FDE92900ACD198 /* MockWebSocketTests.swift */, - 9B7BDA8A23FDE92900ACD198 /* SplitNetworkTransportTests.swift */, - 9B7BDA8823FDE92900ACD198 /* StarWarsSubscriptionTests.swift */, - 9B7BDA8C23FDE92900ACD198 /* StarWarsWebSocketTests.swift */, - D90F1AF92479DEE5007A1534 /* WebSocketTransportTests.swift */, - 9B7BDA8B23FDE92900ACD198 /* Info.plist */, - ); - path = ApolloWebsocketTests; - sourceTree = ""; - }; 9B7BDA9323FDE94C00ACD198 /* ApolloWebSocket */ = { isa = PBXGroup; children = ( @@ -1446,26 +1308,6 @@ path = Sources/ApolloSQLite; sourceTree = ""; }; - 9B7BDAD323FDEC9B00ACD198 /* ApolloSQLiteTests */ = { - isa = PBXGroup; - children = ( - 9B7BDAD423FDEC9B00ACD198 /* CachePersistenceTests.swift */, - 9B7BDAD523FDEC9B00ACD198 /* Info.plist */, - ); - path = ApolloSQLiteTests; - sourceTree = ""; - }; - 9B7BDAEB23FDED9700ACD198 /* ApolloSQLiteTestSupport */ = { - isa = PBXGroup; - children = ( - 9B7BDAEC23FDED9700ACD198 /* TestCacheProvider.swift */, - 9B7BDAED23FDED9700ACD198 /* ApolloSQLiteTestSupport.h */, - 9B7BDAEE23FDED9700ACD198 /* Info.plist */, - ); - name = ApolloSQLiteTestSupport; - path = Sources/ApolloSQLiteTestSupport; - sourceTree = SOURCE_ROOT; - }; 9B7BDAF923FDEE8A00ACD198 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -1560,6 +1402,7 @@ 9BCF0CDF23FC9CA50031D2A2 /* MockNetworkTransport.swift */, 9F3910262549741400AF54A6 /* MockGraphQLServer.swift */, 9BCF0CD923FC9CA50031D2A2 /* TestCacheProvider.swift */, + 9B7BDAEC23FDED9700ACD198 /* SQLiteTestCacheProvider.swift */, 9BEEDC2A24E61995001D1294 /* TestURLs.swift */, 9BCF0CDC23FC9CA50031D2A2 /* XCTAssertHelpers.swift */, 9FBE0D3F25407B64002ED0B1 /* AsyncResultObserver.swift */, @@ -1685,21 +1528,6 @@ path = ApolloPerformanceTests; sourceTree = ""; }; - 9FA6ABBD1EC0A988000017BE /* ApolloCacheDependentTests */ = { - isa = PBXGroup; - children = ( - 9BB4F5B12581AA50004F0BD6 /* CacheDependentInterceptorTests.swift */, - 9FA6ABC51EC0A9F7000017BE /* FetchQueryTests.swift */, - 9FA6ABC61EC0A9F7000017BE /* LoadQueryFromStoreTests.swift */, - 9F8622F71EC2004200C38162 /* ReadWriteFromStoreTests.swift */, - 9B60204E23FDFA9F00D0C8E0 /* SQLiteCacheTests.swift */, - 9FD03C2D25527CE6002227DC /* StoreConcurrencyTests.swift */, - 9FA6ABCB1EC0A9F7000017BE /* WatchQueryTests.swift */, - 9FA6ABC01EC0A988000017BE /* Info.plist */, - ); - path = ApolloCacheDependentTests; - sourceTree = ""; - }; 9FC4B9231D2BE4F00046A641 /* JSON */ = { isa = PBXGroup; children = ( @@ -1739,16 +1567,12 @@ 9FC750441D2A532C00458D91 /* Apollo.framework */, 9FC7504E1D2A532D00458D91 /* ApolloTests.xctest */, 9FCE2CFA1E6C213D00E34457 /* StarWarsAPI.framework */, - 9FA6ABBC1EC0A988000017BE /* ApolloCacheDependentTests.xctest */, 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */, 9FACA9C61F42E67200AE2DBD /* GitHubAPI.framework */, 9B7B6F47233C26D100F32205 /* ApolloCodegenLib.framework */, 9BAEEBFC234BB8FD00808306 /* ApolloCodegenTests.xctest */, - 9B7BDA6F23FDE8F200ACD198 /* ApolloWebSocketTests.xctest */, 9B7BDA7D23FDE90400ACD198 /* ApolloWebSocket.framework */, - 9B7BDAB123FDEBA800ACD198 /* ApolloSQLiteTests.xctest */, 9B7BDABF23FDEBB600ACD198 /* ApolloSQLite.framework */, - 9B7BDAE223FDED8000ACD198 /* ApolloSQLiteTestSupport.framework */, 9B68353E2463481A00337AE6 /* ApolloCore.framework */, 9B2DFBB624E1FA0D00ED3AE6 /* UploadAPI.framework */, 9B2DFBCA24E2016800ED3AE6 /* UploadAPI.framework */, @@ -1784,6 +1608,8 @@ 9FC750521D2A532D00458D91 /* ApolloTests */ = { isa = PBXGroup; children = ( + DED45E9B261BA0CA0086EF63 /* WebSocket */, + DED45DE8261B969F0086EF63 /* Cache */, 9B0417812390320A00C9EC4E /* TestHelpers */, 9FC750551D2A532D00458D91 /* Info.plist */, D87AC09E2564D60B0079FAA5 /* ApolloClientOperationTests.swift */, @@ -1808,8 +1634,7 @@ 9B96500824BE6201003C29C0 /* RequestChainTests.swift */, DED45C292615319E0086EF63 /* LegacyInterceptorProviderTests.swift */, C338DF1622DD9DE9006AF33E /* RequestBodyCreatorTests.swift */, - 9B4F4542244A2AD300C2CF7D /* URLSessionClientTests.swift */, - 9B9BBB1A24DB75E60021C30F /* UploadTests.swift */, + 9B9BBB1A24DB75E60021C30F /* UploadRequestTests.swift */, 5BB2C0222380836100774170 /* VersionNumberTests.swift */, 9B2061162591B3550020D1E0 /* Resources */, ); @@ -1865,16 +1690,14 @@ 9FCE2CF41E6C20E000E34457 /* Tests */ = { isa = PBXGroup; children = ( - DE6B15892615294F0068D642 /* UnitTestPlan.xctestplan */, + DED45DC7261682260086EF63 /* Apollo-UnitTestPlan.xctestplan */, + DED45C3B26165DD70086EF63 /* Apollo-IntegrationTestPlan.xctestplan */, + DE6B15892615294F0068D642 /* ApolloWebSocket-UnitTestPlan.xctestplan */, 9FC750521D2A532D00458D91 /* ApolloTests */, - 9FA6ABBD1EC0A988000017BE /* ApolloCacheDependentTests */, 9F54C8B5255D760B0065AFD6 /* ApolloPerformanceTests */, 9BAEEC0A234BB95B00808306 /* ApolloCodegenTests */, DE6B15AD26152BE10068D642 /* ApolloServerIntegrationTests */, - 9B7BDAD323FDEC9B00ACD198 /* ApolloSQLiteTests */, - 9B7BDAEB23FDED9700ACD198 /* ApolloSQLiteTestSupport */, 9BCF0CD823FC9CA50031D2A2 /* ApolloTestSupport */, - 9B7BDA8623FDE92900ACD198 /* ApolloWebsocketTests */, ); path = Tests; sourceTree = ""; @@ -1958,7 +1781,11 @@ DE6B15AE26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift */, 9FA6ABC91EC0A9F7000017BE /* StarWarsServerTests.swift */, 9FA6ABC81EC0A9F7000017BE /* StarWarsServerCachingRoundtripTests.swift */, + 9B7BDA8823FDE92900ACD198 /* StarWarsSubscriptionTests.swift */, + 9B7BDA8C23FDE92900ACD198 /* StarWarsWebSocketTests.swift */, + 9B4F4542244A2AD300C2CF7D /* URLSessionClientTests.swift */, DE6B15B026152BE10068D642 /* Info.plist */, + DED45F49261CDBFC0086EF63 /* UploadTests.swift */, ); path = ApolloServerIntegrationTests; sourceTree = ""; @@ -2000,6 +1827,40 @@ path = TestHelpers; sourceTree = ""; }; + DED45DE8261B969F0086EF63 /* Cache */ = { + isa = PBXGroup; + children = ( + DED45E2F261B971F0086EF63 /* SQLite */, + 9BB4F5B12581AA50004F0BD6 /* CacheDependentInterceptorTests.swift */, + 9FA6ABC51EC0A9F7000017BE /* FetchQueryTests.swift */, + 9FA6ABC61EC0A9F7000017BE /* LoadQueryFromStoreTests.swift */, + 9F8622F71EC2004200C38162 /* ReadWriteFromStoreTests.swift */, + 9FD03C2D25527CE6002227DC /* StoreConcurrencyTests.swift */, + 9FA6ABCB1EC0A9F7000017BE /* WatchQueryTests.swift */, + ); + path = Cache; + sourceTree = ""; + }; + DED45E2F261B971F0086EF63 /* SQLite */ = { + isa = PBXGroup; + children = ( + 9B60204E23FDFA9F00D0C8E0 /* SQLiteCacheTests.swift */, + 9B7BDAD423FDEC9B00ACD198 /* CachePersistenceTests.swift */, + ); + path = SQLite; + sourceTree = ""; + }; + DED45E9B261BA0CA0086EF63 /* WebSocket */ = { + isa = PBXGroup; + children = ( + 9B7BDA8723FDE92900ACD198 /* MockWebSocket.swift */, + 9B7BDA8923FDE92900ACD198 /* WebSocketTests.swift */, + 9B7BDA8A23FDE92900ACD198 /* SplitNetworkTransportTests.swift */, + D90F1AF92479DEE5007A1534 /* WebSocketTransportTests.swift */, + ); + path = WebSocket; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -2039,14 +1900,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDADD23FDED8000ACD198 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 9B7BDAF023FDED9700ACD198 /* ApolloSQLiteTestSupport.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9F8A95751EC0FC1200304A2D /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; @@ -2151,26 +2004,6 @@ productReference = 9B7B6F47233C26D100F32205 /* ApolloCodegenLib.framework */; productType = "com.apple.product-type.framework"; }; - 9B7BDA6E23FDE8F200ACD198 /* ApolloWebSocketTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 9B7BDA7723FDE8F200ACD198 /* Build configuration list for PBXNativeTarget "ApolloWebSocketTests" */; - buildPhases = ( - 9B7BDA6B23FDE8F200ACD198 /* Sources */, - 9B7BDA6C23FDE8F200ACD198 /* Frameworks */, - 9B7BDA6D23FDE8F200ACD198 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 9B7BDB0723FDF04000ACD198 /* PBXTargetDependency */, - 9B7BDB0323FDF01B00ACD198 /* PBXTargetDependency */, - 9B7BDB0123FDF01600ACD198 /* PBXTargetDependency */, - ); - name = ApolloWebSocketTests; - productName = ApolloWebSocketTests; - productReference = 9B7BDA6F23FDE8F200ACD198 /* ApolloWebSocketTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 9B7BDA7C23FDE90400ACD198 /* ApolloWebSocket */ = { isa = PBXNativeTarget; buildConfigurationList = 9B7BDA8223FDE90400ACD198 /* Build configuration list for PBXNativeTarget "ApolloWebSocket" */; @@ -2194,26 +2027,6 @@ productReference = 9B7BDA7D23FDE90400ACD198 /* ApolloWebSocket.framework */; productType = "com.apple.product-type.framework"; }; - 9B7BDAB023FDEBA800ACD198 /* ApolloSQLiteTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 9B7BDAB623FDEBA800ACD198 /* Build configuration list for PBXNativeTarget "ApolloSQLiteTests" */; - buildPhases = ( - 9B7BDAAD23FDEBA800ACD198 /* Sources */, - 9B7BDAAE23FDEBA800ACD198 /* Frameworks */, - 9B7BDAAF23FDEBA800ACD198 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 9B7BDB1C23FDF22000ACD198 /* PBXTargetDependency */, - 9B7BDB1023FDF08F00ACD198 /* PBXTargetDependency */, - 9B7BDB1223FDF08F00ACD198 /* PBXTargetDependency */, - ); - name = ApolloSQLiteTests; - productName = ApolloSQLiteTests; - productReference = 9B7BDAB123FDEBA800ACD198 /* ApolloSQLiteTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 9B7BDABE23FDEBB600ACD198 /* ApolloSQLite */ = { isa = PBXNativeTarget; buildConfigurationList = 9B7BDAC823FDEBB600ACD198 /* Build configuration list for PBXNativeTarget "ApolloSQLite" */; @@ -2237,26 +2050,6 @@ productReference = 9B7BDABF23FDEBB600ACD198 /* ApolloSQLite.framework */; productType = "com.apple.product-type.framework"; }; - 9B7BDAE123FDED8000ACD198 /* ApolloSQLiteTestSupport */ = { - isa = PBXNativeTarget; - buildConfigurationList = 9B7BDAE723FDED8000ACD198 /* Build configuration list for PBXNativeTarget "ApolloSQLiteTestSupport" */; - buildPhases = ( - 9B7BDADD23FDED8000ACD198 /* Headers */, - 9B7BDADE23FDED8000ACD198 /* Sources */, - 9B7BDADF23FDED8000ACD198 /* Frameworks */, - 9B7BDAE023FDED8000ACD198 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 9BAD16B823FE361F00007BEF /* PBXTargetDependency */, - 9B7BDB1923FDF11C00ACD198 /* PBXTargetDependency */, - ); - name = ApolloSQLiteTestSupport; - productName = ApolloSQLiteTestSupport; - productReference = 9B7BDAE223FDED8000ACD198 /* ApolloSQLiteTestSupport.framework */; - productType = "com.apple.product-type.framework"; - }; 9BAEEBFB234BB8FD00808306 /* ApolloCodegenTests */ = { isa = PBXNativeTarget; buildConfigurationList = 9BAEEC07234BB8FD00808306 /* Build configuration list for PBXNativeTarget "ApolloCodegenTests" */; @@ -2310,32 +2103,17 @@ ); dependencies = ( 9F65B1201EC106E80090B25F /* PBXTargetDependency */, + DED45E98261B9EFA0086EF63 /* PBXTargetDependency */, + DED45E9A261B9F000086EF63 /* PBXTargetDependency */, + DED45E96261B9EE30086EF63 /* PBXTargetDependency */, ); name = ApolloTestSupport; + packageProductDependencies = ( + ); productName = ApolloTestSupport; productReference = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; productType = "com.apple.product-type.framework"; }; - 9FA6ABBB1EC0A988000017BE /* ApolloCacheDependentTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 9FA6ABC11EC0A988000017BE /* Build configuration list for PBXNativeTarget "ApolloCacheDependentTests" */; - buildPhases = ( - 9FA6ABB81EC0A988000017BE /* Sources */, - 9FA6ABB91EC0A988000017BE /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 9B60204C23FDF4B300D0C8E0 /* PBXTargetDependency */, - 9FA6ABD81EC0AA55000017BE /* PBXTargetDependency */, - 9F8A958F1EC0FFB800304A2D /* PBXTargetDependency */, - 9FA6ABD41EC0AA42000017BE /* PBXTargetDependency */, - ); - name = ApolloCacheDependentTests; - productName = ApolloCacheDependentTests; - productReference = 9FA6ABBC1EC0A988000017BE /* ApolloCacheDependentTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; 9FACA9B71F42E67200AE2DBD /* GitHubAPI */ = { isa = PBXNativeTarget; buildConfigurationList = 9FACA9C21F42E67200AE2DBD /* Build configuration list for PBXNativeTarget "GitHubAPI" */; @@ -2476,21 +2254,12 @@ CreatedOnToolsVersion = 11.0; LastSwiftMigration = 1100; }; - 9B7BDA6E23FDE8F200ACD198 = { - CreatedOnToolsVersion = 11.3.1; - }; 9B7BDA7C23FDE90400ACD198 = { CreatedOnToolsVersion = 11.3.1; }; - 9B7BDAB023FDEBA800ACD198 = { - CreatedOnToolsVersion = 11.3.1; - }; 9B7BDABE23FDEBB600ACD198 = { CreatedOnToolsVersion = 11.3.1; }; - 9B7BDAE123FDED8000ACD198 = { - CreatedOnToolsVersion = 11.3.1; - }; 9BAEEBFB234BB8FD00808306 = { CreatedOnToolsVersion = 11.0; }; @@ -2502,11 +2271,6 @@ LastSwiftMigration = 1020; ProvisioningStyle = Manual; }; - 9FA6ABBB1EC0A988000017BE = { - CreatedOnToolsVersion = 8.3.2; - LastSwiftMigration = 1020; - ProvisioningStyle = Manual; - }; 9FACA9B71F42E67200AE2DBD = { ProvisioningStyle = Manual; }; @@ -2554,7 +2318,6 @@ 9FC750431D2A532C00458D91 /* Apollo */, 9B68353D2463481A00337AE6 /* ApolloCore */, 9FC7504D1D2A532D00458D91 /* ApolloTests */, - 9FA6ABBB1EC0A988000017BE /* ApolloCacheDependentTests */, 9F54C8B3255D760B0065AFD6 /* ApolloPerformanceTests */, DE3C7A00260A6B9800D2F4FF /* AnimalKingdomAPI */, 9FCE2CF91E6C213D00E34457 /* StarWarsAPI */, @@ -2564,10 +2327,7 @@ 9B7B6F46233C26D100F32205 /* ApolloCodegenLib */, 9BAEEBFB234BB8FD00808306 /* ApolloCodegenTests */, 9B7BDABE23FDEBB600ACD198 /* ApolloSQLite */, - 9B7BDAE123FDED8000ACD198 /* ApolloSQLiteTestSupport */, - 9B7BDAB023FDEBA800ACD198 /* ApolloSQLiteTests */, 9B7BDA7C23FDE90400ACD198 /* ApolloWebSocket */, - 9B7BDA6E23FDE8F200ACD198 /* ApolloWebSocketTests */, DE6B15AB26152BE10068D642 /* ApolloServerIntegrationTests */, ); }; @@ -2596,13 +2356,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDA6D23FDE8F200ACD198 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9B7BDA7B23FDE90400ACD198 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2610,13 +2363,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDAAF23FDEBA800ACD198 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9B7BDABD23FDEBB600ACD198 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2624,13 +2370,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDAE023FDED8000ACD198 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9BAEEBFA234BB8FD00808306 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2816,19 +2555,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDA6B23FDE8F200ACD198 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9B7BDA8D23FDE92A00ACD198 /* MockWebSocket.swift in Sources */, - 9B7BDA8F23FDE92A00ACD198 /* MockWebSocketTests.swift in Sources */, - 9B7BDA9223FDE92A00ACD198 /* StarWarsWebSocketTests.swift in Sources */, - 9B7BDA9023FDE92A00ACD198 /* SplitNetworkTransportTests.swift in Sources */, - 9B7BDA8E23FDE92A00ACD198 /* StarWarsSubscriptionTests.swift in Sources */, - D90F1AFB2479E57A007A1534 /* WebSocketTransportTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9B7BDA7923FDE90400ACD198 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2842,14 +2568,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDAAD23FDEBA800ACD198 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9B7BDAD623FDEC9B00ACD198 /* CachePersistenceTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9B7BDABB23FDEBB600ACD198 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2861,14 +2579,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9B7BDADE23FDED8000ACD198 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9B7BDAEF23FDED9700ACD198 /* TestCacheProvider.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9BAEEBF8234BB8FD00808306 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -2935,6 +2645,7 @@ 9BCF0CE423FC9CA50031D2A2 /* MockURLSession.swift in Sources */, 9FBE0D4025407B64002ED0B1 /* AsyncResultObserver.swift in Sources */, 9F3910272549741400AF54A6 /* MockGraphQLServer.swift in Sources */, + DED45E6B261B9EAC0086EF63 /* SQLiteTestCacheProvider.swift in Sources */, 9BEEDC2B24E61995001D1294 /* TestURLs.swift in Sources */, 9BCF0CE023FC9CA50031D2A2 /* TestCacheProvider.swift in Sources */, 9BCF0CE323FC9CA50031D2A2 /* XCTAssertHelpers.swift in Sources */, @@ -2943,20 +2654,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 9FA6ABB81EC0A988000017BE /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 9BB4F5B22581AA50004F0BD6 /* CacheDependentInterceptorTests.swift in Sources */, - 9FD03C2E25527CE7002227DC /* StoreConcurrencyTests.swift in Sources */, - 9F39101725493DDC00AF54A6 /* FetchQueryTests.swift in Sources */, - 9FA6ABCD1EC0A9F7000017BE /* LoadQueryFromStoreTests.swift in Sources */, - 9FA6ABD21EC0A9F7000017BE /* WatchQueryTests.swift in Sources */, - 9B60204F23FDFA9F00D0C8E0 /* SQLiteCacheTests.swift in Sources */, - 9F8622F81EC2004200C38162 /* ReadWriteFromStoreTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 9FACA9BB1F42E67200AE2DBD /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -3042,17 +2739,22 @@ buildActionMask = 2147483647; files = ( 5BB2C0232380836100774170 /* VersionNumberTests.swift in Sources */, + DED45EC3261BA0ED0086EF63 /* WebSocketTransportTests.swift in Sources */, 9B78C71E2326E86E000C8C32 /* ErrorGenerationTests.swift in Sources */, + DED45EC7261BA0ED0086EF63 /* WebSocketTests.swift in Sources */, 9FC9A9C81E2EFE6E0023C4D5 /* CacheKeyForFieldTests.swift in Sources */, 9BF6C99C25195019000D5B93 /* String+IncludesForTesting.swift in Sources */, + DED45EC5261BA0ED0086EF63 /* MockWebSocket.swift in Sources */, + DED45DEF261B96B70086EF63 /* ReadWriteFromStoreTests.swift in Sources */, 9F91CF8F1F6C0DB2008DD0BE /* MutatingResultsTests.swift in Sources */, - 9B9BBB1C24DB760B0021C30F /* UploadTests.swift in Sources */, + 9B9BBB1C24DB760B0021C30F /* UploadRequestTests.swift in Sources */, 9BC139A424EDCA6C00876D29 /* InterceptorTests.swift in Sources */, F82E62E122BCD223000C311B /* AutomaticPersistedQueriesTests.swift in Sources */, 9BC139A824EDCE4F00876D29 /* RetryToCountThenSucceedInterceptor.swift in Sources */, - 9B4F4543244A2AD300C2CF7D /* URLSessionClientTests.swift in Sources */, 9F533AB31E6C4A4200CBE097 /* BatchedLoadTests.swift in Sources */, + DED45DEE261B96B70086EF63 /* FetchQueryTests.swift in Sources */, C3279FC72345234D00224790 /* TestCustomRequestBodyCreator.swift in Sources */, + DED45DED261B96B70086EF63 /* StoreConcurrencyTests.swift in Sources */, 9B95EDC022CAA0B000702BB2 /* GETTransformerTests.swift in Sources */, 9FF90A6F1DDDEB420034C3B6 /* GraphQLMapEncodingTests.swift in Sources */, D87AC09F2564D60B0079FAA5 /* ApolloClientOperationTests.swift in Sources */, @@ -3061,17 +2763,23 @@ 9B21FD772422C8CC00998B5C /* TestFileHelper.swift in Sources */, 9BC139A624EDCAD900876D29 /* BlindRetryingTestInterceptor.swift in Sources */, 9B96500A24BE62B7003C29C0 /* RequestChainTests.swift in Sources */, + DED45DEA261B96B70086EF63 /* WatchQueryTests.swift in Sources */, + DED45E30261B972C0086EF63 /* CachePersistenceTests.swift in Sources */, + DED45EC4261BA0ED0086EF63 /* SplitNetworkTransportTests.swift in Sources */, 9B21FD752422C29D00998B5C /* GraphQLFileTests.swift in Sources */, E86D8E05214B32FD0028EFE1 /* JSONTests.swift in Sources */, 9F8622FA1EC2117C00C38162 /* FragmentConstructionAndConversionTests.swift in Sources */, DED45C2A2615319E0086EF63 /* LegacyInterceptorProviderTests.swift in Sources */, 9F21730E2567E6F000566121 /* DataLoaderTests.swift in Sources */, + DED45DEC261B96B70086EF63 /* CacheDependentInterceptorTests.swift in Sources */, + DED45DEB261B96B70086EF63 /* SQLiteCacheTests.swift in Sources */, C338DF1722DD9DE9006AF33E /* RequestBodyCreatorTests.swift in Sources */, F16D083C21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift in Sources */, 9BF6C97025194ED7000D5B93 /* MultipartFormDataTests.swift in Sources */, 9FF90A711DDDEB420034C3B6 /* ReadFieldValueTests.swift in Sources */, 9F295E311E27534800A24949 /* NormalizeQueryResults.swift in Sources */, 9FF90A731DDDEB420034C3B6 /* ParseQueryResponseTests.swift in Sources */, + DED45DE9261B96B70086EF63 /* LoadQueryFromStoreTests.swift in Sources */, 9BF6C94325194DE2000D5B93 /* MultipartFormData+Testing.swift in Sources */, 9B4F4541244A2A9200C2CF7D /* HTTPBinAPI.swift in Sources */, 9F21735B2568F3E200566121 /* PossiblyDeferredTests.swift in Sources */, @@ -3097,10 +2805,14 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + DED45EFE261CDA2A0086EF63 /* StarWarsSubscriptionTests.swift in Sources */, DED45D852616759C0086EF63 /* TestConfigs.swift in Sources */, DED45D9626167F020086EF63 /* StarWarsServerCachingRoundtripTests.swift in Sources */, DE6B15AF26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift in Sources */, + DED45F4A261CDBFC0086EF63 /* UploadTests.swift in Sources */, + DED45F17261CDA360086EF63 /* StarWarsWebSocketTests.swift in Sources */, DED45D73261675890086EF63 /* StarWarsServerTests.swift in Sources */, + DED45F30261CDB560086EF63 /* URLSessionClientTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3117,11 +2829,6 @@ target = 9B2DFBB524E1FA0D00ED3AE6 /* UploadAPI */; targetProxy = 9B2DFBCB24E201A000ED3AE6 /* PBXContainerItemProxy */; }; - 9B60204C23FDF4B300D0C8E0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9B7BDAE123FDED8000ACD198 /* ApolloSQLiteTestSupport */; - targetProxy = 9B60204B23FDF4B300D0C8E0 /* PBXContainerItemProxy */; - }; 9B683549246348CB00337AE6 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9B68353D2463481A00337AE6 /* ApolloCore */; @@ -3146,55 +2853,15 @@ isa = PBXTargetDependency; productRef = 9B7BDAFE23FDEF9E00ACD198 /* Starscream */; }; - 9B7BDB0123FDF01600ACD198 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9B7BDA7C23FDE90400ACD198 /* ApolloWebSocket */; - targetProxy = 9B7BDB0023FDF01600ACD198 /* PBXContainerItemProxy */; - }; - 9B7BDB0323FDF01B00ACD198 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9FCE2CF91E6C213D00E34457 /* StarWarsAPI */; - targetProxy = 9B7BDB0223FDF01B00ACD198 /* PBXContainerItemProxy */; - }; - 9B7BDB0723FDF04000ACD198 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9F8A95771EC0FC1200304A2D /* ApolloTestSupport */; - targetProxy = 9B7BDB0623FDF04000ACD198 /* PBXContainerItemProxy */; - }; - 9B7BDB1023FDF08F00ACD198 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9B7BDAE123FDED8000ACD198 /* ApolloSQLiteTestSupport */; - targetProxy = 9B7BDB0F23FDF08F00ACD198 /* PBXContainerItemProxy */; - }; - 9B7BDB1223FDF08F00ACD198 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9F8A95771EC0FC1200304A2D /* ApolloTestSupport */; - targetProxy = 9B7BDB1123FDF08F00ACD198 /* PBXContainerItemProxy */; - }; 9B7BDB1723FDF10300ACD198 /* PBXTargetDependency */ = { isa = PBXTargetDependency; productRef = 9B7BDB1623FDF10300ACD198 /* SQLite */; }; - 9B7BDB1923FDF11C00ACD198 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9B7BDABE23FDEBB600ACD198 /* ApolloSQLite */; - targetProxy = 9B7BDB1823FDF11C00ACD198 /* PBXContainerItemProxy */; - }; - 9B7BDB1C23FDF22000ACD198 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9FCE2CF91E6C213D00E34457 /* StarWarsAPI */; - targetProxy = 9B7BDB1B23FDF22000ACD198 /* PBXContainerItemProxy */; - }; 9B8C3FBC248DAA0400707B13 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9B68353D2463481A00337AE6 /* ApolloCore */; targetProxy = 9B8C3FBB248DAA0400707B13 /* PBXContainerItemProxy */; }; - 9BAD16B823FE361F00007BEF /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9F8A95771EC0FC1200304A2D /* ApolloTestSupport */; - targetProxy = 9BAD16B723FE361F00007BEF /* PBXContainerItemProxy */; - }; 9BAEEC03234BB8FD00808306 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9B7B6F46233C26D100F32205 /* ApolloCodegenLib */; @@ -3230,26 +2897,11 @@ target = 9F8A95771EC0FC1200304A2D /* ApolloTestSupport */; targetProxy = 9F8A958B1EC0FF9F00304A2D /* PBXContainerItemProxy */; }; - 9F8A958F1EC0FFB800304A2D /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9F8A95771EC0FC1200304A2D /* ApolloTestSupport */; - targetProxy = 9F8A958E1EC0FFB800304A2D /* PBXContainerItemProxy */; - }; 9FA5FBB61EC05CE900304A9D /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9FC750431D2A532C00458D91 /* Apollo */; targetProxy = 9FA5FBB51EC05CE900304A9D /* PBXContainerItemProxy */; }; - 9FA6ABD41EC0AA42000017BE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9FCE2CF91E6C213D00E34457 /* StarWarsAPI */; - targetProxy = 9FA6ABD31EC0AA42000017BE /* PBXContainerItemProxy */; - }; - 9FA6ABD81EC0AA55000017BE /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9FC750431D2A532C00458D91 /* Apollo */; - targetProxy = 9FA6ABD71EC0AA55000017BE /* PBXContainerItemProxy */; - }; 9FACA9B81F42E67200AE2DBD /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9FC750431D2A532C00458D91 /* Apollo */; @@ -3280,6 +2932,20 @@ target = 9FC750431D2A532C00458D91 /* Apollo */; targetProxy = DE6B15B226152BE10068D642 /* PBXContainerItemProxy */; }; + DED45E96261B9EE30086EF63 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + productRef = DED45E95261B9EE30086EF63 /* SQLite */; + }; + DED45E98261B9EFA0086EF63 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9B7BDABE23FDEBB600ACD198 /* ApolloSQLite */; + targetProxy = DED45E97261B9EFA0086EF63 /* PBXContainerItemProxy */; + }; + DED45E9A261B9F000086EF63 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9B7BDA7C23FDE90400ACD198 /* ApolloWebSocket */; + targetProxy = DED45E99261B9F000086EF63 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -3346,27 +3012,6 @@ }; name = PerformanceTesting; }; - 9B7BDA7423FDE8F200ACD198 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9B7BDAA223FDE98B00ACD198 /* ApolloWebSocket-Target-Tests.xcconfig */; - buildSettings = { - }; - name = Debug; - }; - 9B7BDA7523FDE8F200ACD198 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9B7BDAA223FDE98B00ACD198 /* ApolloWebSocket-Target-Tests.xcconfig */; - buildSettings = { - }; - name = Release; - }; - 9B7BDA7623FDE8F200ACD198 /* PerformanceTesting */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9B7BDAA223FDE98B00ACD198 /* ApolloWebSocket-Target-Tests.xcconfig */; - buildSettings = { - }; - name = PerformanceTesting; - }; 9B7BDA8323FDE90400ACD198 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9B7BDAA423FDE98C00ACD198 /* ApolloWebSocket-Target-Framework.xcconfig */; @@ -3388,27 +3033,6 @@ }; name = PerformanceTesting; }; - 9B7BDAB723FDEBA800ACD198 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9B7BDAA223FDE98B00ACD198 /* ApolloWebSocket-Target-Tests.xcconfig */; - buildSettings = { - }; - name = Debug; - }; - 9B7BDAB823FDEBA800ACD198 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9B7BDADA23FDECB400ACD198 /* ApolloSQLite-Target-Tests.xcconfig */; - buildSettings = { - }; - name = Release; - }; - 9B7BDAB923FDEBA800ACD198 /* PerformanceTesting */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9B7BDADA23FDECB400ACD198 /* ApolloSQLite-Target-Tests.xcconfig */; - buildSettings = { - }; - name = PerformanceTesting; - }; 9B7BDAC923FDEBB600ACD198 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9B7BDAD823FDECB300ACD198 /* ApolloSQLite-Target-Framework.xcconfig */; @@ -3430,27 +3054,6 @@ }; name = PerformanceTesting; }; - 9B7BDAE823FDED8000ACD198 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9B7BDADB23FDECB400ACD198 /* ApolloSQLite-Target-TestSupport.xcconfig */; - buildSettings = { - }; - name = Debug; - }; - 9B7BDAE923FDED8000ACD198 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9B7BDADB23FDECB400ACD198 /* ApolloSQLite-Target-TestSupport.xcconfig */; - buildSettings = { - }; - name = Release; - }; - 9B7BDAEA23FDED8000ACD198 /* PerformanceTesting */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9B7BDADB23FDECB400ACD198 /* ApolloSQLite-Target-TestSupport.xcconfig */; - buildSettings = { - }; - name = PerformanceTesting; - }; 9BAEEC04234BB8FD00808306 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 9B4AA8AD239EFDC9003E1300 /* Apollo-Target-CodegenTests.xcconfig */; @@ -3514,27 +3117,6 @@ }; name = PerformanceTesting; }; - 9FA6ABC21EC0A988000017BE /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 90690D2322433C5900FC2E54 /* Apollo-Target-CacheDependentTests.xcconfig */; - buildSettings = { - }; - name = Debug; - }; - 9FA6ABC31EC0A988000017BE /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 90690D2322433C5900FC2E54 /* Apollo-Target-CacheDependentTests.xcconfig */; - buildSettings = { - }; - name = Release; - }; - 9FA6ABC41EC0A988000017BE /* PerformanceTesting */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 90690D2322433C5900FC2E54 /* Apollo-Target-CacheDependentTests.xcconfig */; - buildSettings = { - }; - name = PerformanceTesting; - }; 9FACA9C31F42E67200AE2DBD /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 90690D2222433C2800FC2E54 /* Apollo-Target-GitHubAPI.xcconfig */; @@ -3715,16 +3297,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9B7BDA7723FDE8F200ACD198 /* Build configuration list for PBXNativeTarget "ApolloWebSocketTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9B7BDA7423FDE8F200ACD198 /* Debug */, - 9B7BDA7523FDE8F200ACD198 /* Release */, - 9B7BDA7623FDE8F200ACD198 /* PerformanceTesting */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 9B7BDA8223FDE90400ACD198 /* Build configuration list for PBXNativeTarget "ApolloWebSocket" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -3735,16 +3307,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9B7BDAB623FDEBA800ACD198 /* Build configuration list for PBXNativeTarget "ApolloSQLiteTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9B7BDAB723FDEBA800ACD198 /* Debug */, - 9B7BDAB823FDEBA800ACD198 /* Release */, - 9B7BDAB923FDEBA800ACD198 /* PerformanceTesting */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 9B7BDAC823FDEBB600ACD198 /* Build configuration list for PBXNativeTarget "ApolloSQLite" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -3755,16 +3317,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9B7BDAE723FDED8000ACD198 /* Build configuration list for PBXNativeTarget "ApolloSQLiteTestSupport" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9B7BDAE823FDED8000ACD198 /* Debug */, - 9B7BDAE923FDED8000ACD198 /* Release */, - 9B7BDAEA23FDED8000ACD198 /* PerformanceTesting */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 9BAEEC07234BB8FD00808306 /* Build configuration list for PBXNativeTarget "ApolloCodegenTests" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -3795,16 +3347,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 9FA6ABC11EC0A988000017BE /* Build configuration list for PBXNativeTarget "ApolloCacheDependentTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 9FA6ABC21EC0A988000017BE /* Debug */, - 9FA6ABC31EC0A988000017BE /* Release */, - 9FA6ABC41EC0A988000017BE /* PerformanceTesting */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 9FACA9C21F42E67200AE2DBD /* Build configuration list for PBXNativeTarget "GitHubAPI" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -3943,6 +3485,11 @@ package = 9B7BDAF423FDEE2600ACD198 /* XCRemoteSwiftPackageReference "SQLite.swift" */; productName = SQLite; }; + DED45E95261B9EE30086EF63 /* SQLite */ = { + isa = XCSwiftPackageProductDependency; + package = 9B7BDAF423FDEE2600ACD198 /* XCRemoteSwiftPackageReference "SQLite.swift" */; + productName = SQLite; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 9FC7503B1D2A532C00458D91 /* Project object */; diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme index 7da513b1cc..c59be33460 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -55,6 +55,12 @@ ReferencedContainer = "container:Apollo.xcodeproj"> + + + + diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme index 7042c3990c..f32e7a8fdb 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -46,6 +46,12 @@ ReferencedContainer = "container:Apollo.xcodeproj"> + + + + diff --git a/Sources/ApolloSQLiteTestSupport/ApolloSQLiteTestSupport.h b/Sources/ApolloSQLiteTestSupport/ApolloSQLiteTestSupport.h deleted file mode 100644 index 20f660686a..0000000000 --- a/Sources/ApolloSQLiteTestSupport/ApolloSQLiteTestSupport.h +++ /dev/null @@ -1,11 +0,0 @@ -#import - -//! Project version number for ApolloSQLiteTestSupport. -FOUNDATION_EXPORT double ApolloSQLiteTestSupportVersionNumber; - -//! Project version string for ApolloSQLiteTestSupport. -FOUNDATION_EXPORT const unsigned char ApolloSQLiteTestSupportVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/Sources/ApolloSQLiteTestSupport/Info.plist b/Sources/ApolloSQLiteTestSupport/Info.plist deleted file mode 100644 index fbe1e6b314..0000000000 --- a/Sources/ApolloSQLiteTestSupport/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/Sources/ApolloSQLiteTestSupport/TestCacheProvider.swift b/Sources/ApolloTestSupport/SQLiteTestCacheProvider.swift similarity index 98% rename from Sources/ApolloSQLiteTestSupport/TestCacheProvider.swift rename to Sources/ApolloTestSupport/SQLiteTestCacheProvider.swift index 9e44960e74..55bebd166b 100644 --- a/Sources/ApolloSQLiteTestSupport/TestCacheProvider.swift +++ b/Sources/ApolloTestSupport/SQLiteTestCacheProvider.swift @@ -1,6 +1,5 @@ import Foundation import Apollo -import ApolloTestSupport import ApolloSQLite public class SQLiteTestCacheProvider: TestCacheProvider { diff --git a/Tests/Apollo-IntegrationTestPlan.xctestplan b/Tests/Apollo-IntegrationTestPlan.xctestplan new file mode 100644 index 0000000000..0d288226bb --- /dev/null +++ b/Tests/Apollo-IntegrationTestPlan.xctestplan @@ -0,0 +1,26 @@ +{ + "configurations" : [ + { + "id" : "8F157DCD-D977-4EAA-80AD-D947EF785D9D", + "name" : "Configuration 1", + "options" : { + "environmentVariableEntries" : [ + + ] + } + } + ], + "defaultOptions" : { + + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:Apollo.xcodeproj", + "identifier" : "DE6B15AB26152BE10068D642", + "name" : "ApolloServerIntegrationTests" + } + } + ], + "version" : 1 +} diff --git a/Tests/ApolloCacheDependentTests/UnitTestPlan.xctestplan b/Tests/Apollo-UnitTestPlan.xctestplan similarity index 86% rename from Tests/ApolloCacheDependentTests/UnitTestPlan.xctestplan rename to Tests/Apollo-UnitTestPlan.xctestplan index fe77778b88..2314709c07 100644 --- a/Tests/ApolloCacheDependentTests/UnitTestPlan.xctestplan +++ b/Tests/Apollo-UnitTestPlan.xctestplan @@ -1,7 +1,7 @@ { "configurations" : [ { - "id" : "9CB34656-EFF8-410B-8F79-EF3152F0BDC6", + "id" : "36C7A583-06D6-4733-AF67-CC38D6FB14FF", "name" : "Configuration 1", "options" : { diff --git a/Tests/ApolloCacheDependentTests/Info.plist b/Tests/ApolloCacheDependentTests/Info.plist deleted file mode 100644 index 6c6c23c43a..0000000000 --- a/Tests/ApolloCacheDependentTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/Tests/ApolloSQLiteTests/Info.plist b/Tests/ApolloSQLiteTests/Info.plist deleted file mode 100644 index 6c6c23c43a..0000000000 --- a/Tests/ApolloSQLiteTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/Tests/ApolloWebsocketTests/StarWarsSubscriptionTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift similarity index 100% rename from Tests/ApolloWebsocketTests/StarWarsSubscriptionTests.swift rename to Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift diff --git a/Tests/ApolloWebsocketTests/StarWarsWebSocketTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift similarity index 100% rename from Tests/ApolloWebsocketTests/StarWarsWebSocketTests.swift rename to Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift diff --git a/Tests/ApolloTests/URLSessionClientTests.swift b/Tests/ApolloServerIntegrationTests/URLSessionClientTests.swift similarity index 100% rename from Tests/ApolloTests/URLSessionClientTests.swift rename to Tests/ApolloServerIntegrationTests/URLSessionClientTests.swift diff --git a/Tests/ApolloTests/UploadTests.swift b/Tests/ApolloServerIntegrationTests/UploadTests.swift similarity index 59% rename from Tests/ApolloTests/UploadTests.swift rename to Tests/ApolloServerIntegrationTests/UploadTests.swift index 7bdb704a51..baa09697a5 100644 --- a/Tests/ApolloTests/UploadTests.swift +++ b/Tests/ApolloServerIntegrationTests/UploadTests.swift @@ -5,9 +5,9 @@ import UploadAPI import StarWarsAPI class UploadTests: XCTestCase { - + let uploadClientURL = TestURL.uploadServer.url - + lazy var client: ApolloClient = { let store = ApolloStore() let provider = LegacyInterceptorProvider(store: store) @@ -16,20 +16,20 @@ class UploadTests: XCTestCase { additionalHeaders: ["headerKey": "headerValue"]) transport.clientName = "test" transport.clientVersion = "test" - + return ApolloClient(networkTransport: transport, store: store) }() - + override static func tearDown() { // Recreate the uploads folder at the end of all tests in this suite to avoid having one billion files in there recreateUploadsFolder() super.tearDown() } - + private static func recreateUploadsFolder() { let uploadsFolderURL = TestFileHelper.uploadsFolder() try? FileManager.default.removeItem(at: uploadsFolderURL) - + try? FileManager.default.createDirectory(at: uploadsFolderURL, withIntermediateDirectories: false) } @@ -43,12 +43,12 @@ class UploadTests: XCTestCase { line: line) return } - + let sanitizedPath = String(path.dropFirst(2)) // Gets rid of the ./ returned by the server - + let uploadedFileURL = TestFileHelper.uploadServerFolder() .appendingPathComponent(sanitizedPath) - + do { let initialData = try Data(contentsOf: initialFileURL) let uploadedData = try Data(contentsOf: uploadedFileURL) @@ -71,22 +71,22 @@ class UploadTests: XCTestCase { line: line) } } - + func testUploadingASingleFile() throws { let fileURL = TestFileHelper.fileURLForFile(named: "a", extension: "txt") - + let file = try GraphQLFile(fieldName: "file", originalName: "a.txt", fileURL: fileURL) - + let upload = UploadOneFileMutation(file: "a.txt") - + let expectation = self.expectation(description: "File upload complete") self.client.upload(operation: upload, files: [file]) { result in defer { expectation.fulfill() } - + switch result { case .success(let graphQLResult): XCTAssertEqual(graphQLResult.data?.singleUpload.filename, "a.txt") @@ -95,40 +95,40 @@ class UploadTests: XCTestCase { XCTFail("Unexpected upload error: \(error)") } } - + self.wait(for: [expectation], timeout: 10) } - + func testUploadingMultipleFilesWithTheSameFieldName() throws { let firstFileURL = TestFileHelper.fileURLForFile(named: "a", extension: "txt") - + let firstFile = try GraphQLFile(fieldName: "files", originalName: "a.txt", fileURL: firstFileURL) - + let secondFileURL = TestFileHelper.fileURLForFile(named: "b", extension: "txt") - + let secondFile = try GraphQLFile(fieldName: "files", originalName: "b.txt", fileURL: secondFileURL) - + let files = [firstFile, secondFile] - + let upload = UploadMultipleFilesToTheSameParameterMutation(files: files.map { $0.originalName }) - + let expectation = self.expectation(description: "File upload complete") self.client.upload(operation: upload, files: files) { result in defer { expectation.fulfill() } - + switch result { case .success(let graphQLResult): guard let uploads = graphQLResult.data?.multipleUpload else { XCTFail("NOPE") return } - + XCTAssertEqual(uploads.count, 2) let sortedUploads = uploads.sorted { $0.filename < $1.filename } XCTAssertEqual(sortedUploads[0].filename, "a.txt") @@ -139,50 +139,50 @@ class UploadTests: XCTestCase { XCTFail("Unexpected upload error: \(error)") } } - + self.wait(for: [expectation], timeout: 10) } - + func testUploadingMultipleFilesWithDifferentFieldNames() throws { let firstFileURL = TestFileHelper.fileURLForFile(named: "a", extension: "txt") - + let firstFile = try GraphQLFile(fieldName: "singleFile", originalName: "a.txt", fileURL: firstFileURL) - + let secondFileURL = TestFileHelper.fileURLForFile(named: "b", extension: "txt") - + let secondFile = try GraphQLFile(fieldName: "multipleFiles", originalName: "b.txt", fileURL: secondFileURL) - + let thirdFileURL = TestFileHelper.fileURLForFile(named: "c", extension: "txt") - + let thirdFile = try GraphQLFile(fieldName: "multipleFiles", originalName: "c.txt", fileURL: thirdFileURL) - + // This is the array of Files for the `multipleFiles` parameter only let multipleFiles = [secondFile, thirdFile] let upload = UploadMultipleFilesToDifferentParametersMutation(singleFile: firstFile.originalName, multipleFiles: multipleFiles.map { $0.originalName }) - + let expectation = self.expectation(description: "File upload complete") - + // This is the array of Files for all parameters let allFiles = [firstFile, secondFile, thirdFile] self.client.upload(operation: upload, files: allFiles) { result in defer { expectation.fulfill() } - + switch result { case .success(let graphQLResult): guard let uploads = graphQLResult.data?.multipleParameterUpload else { XCTFail("NOPE") return } - + XCTAssertEqual(uploads.count, 3) let sortedUploads = uploads.sorted { $0.filename < $1.filename } XCTAssertEqual(sortedUploads[0].filename, "a.txt") @@ -195,84 +195,84 @@ class UploadTests: XCTestCase { XCTFail("Unexpected upload error: \(error)") } } - + self.wait(for: [expectation], timeout: 10) } - + func testUploadingASingleFileInAnArray() throws { let fileURL = TestFileHelper.fileURLForFile(named: "a", extension: "txt") - + let file = try GraphQLFile(fieldName: "files", originalName: "a.txt", fileURL: fileURL) - + let filesArray = [file] - + let uploadMutation = UploadMultipleFilesToTheSameParameterMutation(files: filesArray.map { $0.originalName }) - + let expectation = self.expectation(description: "File upload complete") self.client.upload(operation: uploadMutation, files: filesArray) { result in defer { expectation.fulfill() } - + switch result { case .success(let graphQLResult): guard let uploads = graphQLResult.data?.multipleUpload else { XCTFail("NOPE") return } - + XCTAssertEqual(uploads.count, 1) guard let uploadedFile = uploads.first else { XCTFail("Could not access uploaded file!") return } - + XCTAssertEqual(uploadedFile.filename, "a.txt") self.compareInitialFile(at: fileURL, toUploadedFileAt: uploadedFile.path) case .failure(let error): XCTFail("Unexpected upload error: \(error)") } } - + self.wait(for: [expectation], timeout: 10) } - + func testUploadingSingleFileInAnArrayWithAnotherFileForAnotherField() throws { let firstFileURL = TestFileHelper.fileURLForFile(named: "a", extension: "txt") - + let firstFile = try GraphQLFile(fieldName: "singleFile", originalName: "a.txt", fileURL: firstFileURL) - + let secondFileURL = TestFileHelper.fileURLForFile(named: "b", extension: "txt") - + let secondFile = try GraphQLFile(fieldName: "multipleFiles", originalName: "b.txt", fileURL: secondFileURL) - + // This is the array of Files for the `multipleFiles` parameter only let multipleFiles = [secondFile] let upload = UploadMultipleFilesToDifferentParametersMutation(singleFile: firstFile.originalName, multipleFiles: multipleFiles.map { $0.originalName }) - + let expectation = self.expectation(description: "File upload complete") - + // This is the array of Files for all parameters let allFiles = [firstFile, secondFile] self.client.upload(operation: upload, files: allFiles) { result in defer { expectation.fulfill() } - + switch result { case .success(let graphQLResult): guard let uploads = graphQLResult.data?.multipleParameterUpload else { XCTFail("NOPE") return } - + XCTAssertEqual(uploads.count, 2) let sortedUploads = uploads.sorted { $0.filename < $1.filename } XCTAssertEqual(sortedUploads[0].filename, "a.txt") @@ -283,171 +283,8 @@ class UploadTests: XCTestCase { XCTFail("Unexpected upload error: \(error)") } } - - self.wait(for: [expectation], timeout: 10) - } - - // MARK: - UploadRequest - - - func testSingleFileWithUploadRequest() throws { - let alphaFileUrl = TestFileHelper.fileURLForFile(named: "a", extension: "txt") - - let alphaFile = try GraphQLFile(fieldName: "file", - originalName: "a.txt", - mimeType: "text/plain", - fileURL: alphaFileUrl) - let operation = UploadOneFileMutation(file: alphaFile.originalName) - - let transport = try XCTUnwrap(self.client.networkTransport as? RequestChainNetworkTransport) - - let httpRequest = transport.constructUploadRequest(for: operation, - with: [alphaFile], - manualBoundary: "TEST.BOUNDARY") - let uploadRequest = try XCTUnwrap(httpRequest as? UploadRequest) - - let urlRequest = try uploadRequest.toURLRequest() - XCTAssertEqual(urlRequest.allHTTPHeaderFields?["headerKey"], "headerValue") - - let formData = try uploadRequest.requestMultipartFormData() - let stringToCompare = try formData.toTestString() - - let expectedString = """ ---TEST.BOUNDARY -Content-Disposition: form-data; name="operations" - -{"id":"c5d5919f77d9ba16a9689b6b0ad4b781cb05dc1dc4812623bf80f7c044c09533","operationName":"UploadOneFile","query":"mutation UploadOneFile($file: Upload!) {\\n singleUpload(file: $file) {\\n __typename\\n id\\n path\\n filename\\n mimetype\\n }\\n}","variables":{"file":null}} ---TEST.BOUNDARY -Content-Disposition: form-data; name="map" - -{"0":["variables.file"]} ---TEST.BOUNDARY -Content-Disposition: form-data; name="0"; filename="a.txt" -Content-Type: text/plain - -Alpha file content. - ---TEST.BOUNDARY-- -""" - - XCTAssertEqual(stringToCompare, expectedString) - } - func testMultipleFilesWithUploadRequest() throws { - let alphaFileURL = TestFileHelper.fileURLForFile(named: "a", extension: "txt") - let alphaFile = try GraphQLFile(fieldName: "files", - originalName: "a.txt", - mimeType: "text/plain", - fileURL: alphaFileURL) - - let betaFileURL = TestFileHelper.fileURLForFile(named: "b", extension: "txt") - let betaFile = try GraphQLFile(fieldName: "files", - originalName: "b.txt", - mimeType: "text/plain", - fileURL: betaFileURL) - - let files = [alphaFile, betaFile] - let operation = UploadMultipleFilesToTheSameParameterMutation(files: files.map { $0.originalName }) - let transport = try XCTUnwrap(self.client.networkTransport as? RequestChainNetworkTransport) - - let httpRequest = transport.constructUploadRequest(for: operation, - with: [alphaFile, betaFile], - manualBoundary: "TEST.BOUNDARY") - let uploadRequest = try XCTUnwrap(httpRequest as? UploadRequest) - - let urlRequest = try uploadRequest.toURLRequest() - XCTAssertEqual(urlRequest.allHTTPHeaderFields?["headerKey"], "headerValue") - - let multipartData = try uploadRequest.requestMultipartFormData() - let stringToCompare = try multipartData.toTestString() - - let expectedString = """ ---TEST.BOUNDARY -Content-Disposition: form-data; name="operations" - -{"id":"88858c283bb72f18c0049dc85b140e72a4046f469fa16a8bf4bcf01c11d8a2b7","operationName":"UploadMultipleFilesToTheSameParameter","query":"mutation UploadMultipleFilesToTheSameParameter($files: [Upload!]!) {\\n multipleUpload(files: $files) {\\n __typename\\n id\\n path\\n filename\\n mimetype\\n }\\n}","variables":{"files":[null,null]}} ---TEST.BOUNDARY -Content-Disposition: form-data; name="map" - -{"0":["variables.files.0"],"1":["variables.files.1"]} ---TEST.BOUNDARY -Content-Disposition: form-data; name="0"; filename="a.txt" -Content-Type: text/plain - -Alpha file content. - ---TEST.BOUNDARY -Content-Disposition: form-data; name="1"; filename="b.txt" -Content-Type: text/plain - -Bravo file content. - ---TEST.BOUNDARY-- -""" - XCTAssertEqual(stringToCompare, expectedString) + self.wait(for: [expectation], timeout: 10) } - func testMultipleFilesWithMultipleFieldsWithUploadRequest() throws { - let alphaFileURL = TestFileHelper.fileURLForFile(named: "a", extension: "txt") - let alphaFile = try GraphQLFile(fieldName: "uploads", - originalName: "a.txt", - mimeType: "text/plain", - fileURL: alphaFileURL) - - let betaFileURL = TestFileHelper.fileURLForFile(named: "b", extension: "txt") - let betaFile = try GraphQLFile(fieldName: "uploads", - originalName: "b.txt", - mimeType: "text/plain", - fileURL: betaFileURL) - - let charlieFileUrl = TestFileHelper.fileURLForFile(named: "c", extension: "txt") - let charlieFile = try GraphQLFile(fieldName: "secondField", - originalName: "c.txt", - mimeType: "text/plain", - fileURL: charlieFileUrl) - - let transport = try XCTUnwrap(self.client.networkTransport as? RequestChainNetworkTransport) - - let httpRequest = transport.constructUploadRequest(for: HeroNameQuery(), - with: [alphaFile, betaFile, charlieFile], - manualBoundary: "TEST.BOUNDARY") - let uploadRequest = try XCTUnwrap(httpRequest as? UploadRequest) - - let urlRequest = try uploadRequest.toURLRequest() - XCTAssertEqual(urlRequest.allHTTPHeaderFields?["headerKey"], "headerValue") - - let multipartData = try uploadRequest.requestMultipartFormData() - let stringToCompare = try multipartData.toTestString() - - let expectedString = """ ---TEST.BOUNDARY -Content-Disposition: form-data; name="operations" - -{"id":"f6e76545cd03aa21368d9969cb39447f6e836a16717823281803778e7805d671","operationName":"HeroName","query":"query HeroName($episode: Episode) {\\n hero(episode: $episode) {\\n __typename\\n name\\n }\\n}","variables":{"episode":null,\"secondField\":null,\"uploads\":null}} ---TEST.BOUNDARY -Content-Disposition: form-data; name="map" - -{"0":["variables.secondField"],"1":["variables.uploads.0"],"2":["variables.uploads.1"]} ---TEST.BOUNDARY -Content-Disposition: form-data; name="0"; filename="c.txt" -Content-Type: text/plain - -Charlie file content. - ---TEST.BOUNDARY -Content-Disposition: form-data; name="1"; filename="a.txt" -Content-Type: text/plain - -Alpha file content. - ---TEST.BOUNDARY -Content-Disposition: form-data; name="2"; filename="b.txt" -Content-Type: text/plain - -Bravo file content. - ---TEST.BOUNDARY-- -""" - XCTAssertEqual(stringToCompare, expectedString) - } } diff --git a/Tests/ApolloCacheDependentTests/CacheDependentInterceptorTests.swift b/Tests/ApolloTests/Cache/CacheDependentInterceptorTests.swift similarity index 100% rename from Tests/ApolloCacheDependentTests/CacheDependentInterceptorTests.swift rename to Tests/ApolloTests/Cache/CacheDependentInterceptorTests.swift diff --git a/Tests/ApolloCacheDependentTests/FetchQueryTests.swift b/Tests/ApolloTests/Cache/FetchQueryTests.swift similarity index 100% rename from Tests/ApolloCacheDependentTests/FetchQueryTests.swift rename to Tests/ApolloTests/Cache/FetchQueryTests.swift diff --git a/Tests/ApolloCacheDependentTests/LoadQueryFromStoreTests.swift b/Tests/ApolloTests/Cache/LoadQueryFromStoreTests.swift similarity index 100% rename from Tests/ApolloCacheDependentTests/LoadQueryFromStoreTests.swift rename to Tests/ApolloTests/Cache/LoadQueryFromStoreTests.swift diff --git a/Tests/ApolloCacheDependentTests/ReadWriteFromStoreTests.swift b/Tests/ApolloTests/Cache/ReadWriteFromStoreTests.swift similarity index 100% rename from Tests/ApolloCacheDependentTests/ReadWriteFromStoreTests.swift rename to Tests/ApolloTests/Cache/ReadWriteFromStoreTests.swift diff --git a/Tests/ApolloSQLiteTests/CachePersistenceTests.swift b/Tests/ApolloTests/Cache/SQLite/CachePersistenceTests.swift similarity index 99% rename from Tests/ApolloSQLiteTests/CachePersistenceTests.swift rename to Tests/ApolloTests/Cache/SQLite/CachePersistenceTests.swift index 1cfe28666d..3e9fbd688d 100644 --- a/Tests/ApolloSQLiteTests/CachePersistenceTests.swift +++ b/Tests/ApolloTests/Cache/SQLite/CachePersistenceTests.swift @@ -2,7 +2,6 @@ import XCTest @testable import Apollo @testable import ApolloSQLite import ApolloTestSupport -import ApolloSQLiteTestSupport import StarWarsAPI import SQLite diff --git a/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift b/Tests/ApolloTests/Cache/SQLite/SQLiteCacheTests.swift similarity index 95% rename from Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift rename to Tests/ApolloTests/Cache/SQLite/SQLiteCacheTests.swift index 00bcf152b9..9d6eb81c43 100644 --- a/Tests/ApolloCacheDependentTests/SQLiteCacheTests.swift +++ b/Tests/ApolloTests/Cache/SQLite/SQLiteCacheTests.swift @@ -1,6 +1,5 @@ import Foundation import ApolloTestSupport -import ApolloSQLiteTestSupport // These test cases inherit all tests from their superclasses. diff --git a/Tests/ApolloCacheDependentTests/StoreConcurrencyTests.swift b/Tests/ApolloTests/Cache/StoreConcurrencyTests.swift similarity index 100% rename from Tests/ApolloCacheDependentTests/StoreConcurrencyTests.swift rename to Tests/ApolloTests/Cache/StoreConcurrencyTests.swift diff --git a/Tests/ApolloCacheDependentTests/WatchQueryTests.swift b/Tests/ApolloTests/Cache/WatchQueryTests.swift similarity index 100% rename from Tests/ApolloCacheDependentTests/WatchQueryTests.swift rename to Tests/ApolloTests/Cache/WatchQueryTests.swift diff --git a/Tests/ApolloTests/UploadRequestTests.swift b/Tests/ApolloTests/UploadRequestTests.swift new file mode 100644 index 0000000000..50347ca469 --- /dev/null +++ b/Tests/ApolloTests/UploadRequestTests.swift @@ -0,0 +1,181 @@ +import XCTest +@testable import Apollo +import ApolloTestSupport +import UploadAPI +import StarWarsAPI + +class UploadRequestTests: XCTestCase { + + lazy var client: ApolloClient = { + let store = ApolloStore() + let provider = LegacyInterceptorProvider(store: store) + let transport = RequestChainNetworkTransport(interceptorProvider: provider, + endpointURL: URL(string: "http://www.test.com")!, + additionalHeaders: ["headerKey": "headerValue"]) + transport.clientName = "test" + transport.clientVersion = "test" + + return ApolloClient(networkTransport: transport, store: store) + }() + + func testSingleFileWithUploadRequest() throws { + let alphaFileUrl = TestFileHelper.fileURLForFile(named: "a", extension: "txt") + + let alphaFile = try GraphQLFile(fieldName: "file", + originalName: "a.txt", + mimeType: "text/plain", + fileURL: alphaFileUrl) + let operation = UploadOneFileMutation(file: alphaFile.originalName) + + let transport = try XCTUnwrap(self.client.networkTransport as? RequestChainNetworkTransport) + + let httpRequest = transport.constructUploadRequest(for: operation, + with: [alphaFile], + manualBoundary: "TEST.BOUNDARY") + let uploadRequest = try XCTUnwrap(httpRequest as? UploadRequest) + + let urlRequest = try uploadRequest.toURLRequest() + XCTAssertEqual(urlRequest.allHTTPHeaderFields?["headerKey"], "headerValue") + + let formData = try uploadRequest.requestMultipartFormData() + let stringToCompare = try formData.toTestString() + + let expectedString = """ +--TEST.BOUNDARY +Content-Disposition: form-data; name="operations" + +{"id":"c5d5919f77d9ba16a9689b6b0ad4b781cb05dc1dc4812623bf80f7c044c09533","operationName":"UploadOneFile","query":"mutation UploadOneFile($file: Upload!) {\\n singleUpload(file: $file) {\\n __typename\\n id\\n path\\n filename\\n mimetype\\n }\\n}","variables":{"file":null}} +--TEST.BOUNDARY +Content-Disposition: form-data; name="map" + +{"0":["variables.file"]} +--TEST.BOUNDARY +Content-Disposition: form-data; name="0"; filename="a.txt" +Content-Type: text/plain + +Alpha file content. + +--TEST.BOUNDARY-- +""" + + XCTAssertEqual(stringToCompare, expectedString) + } + + func testMultipleFilesWithUploadRequest() throws { + let alphaFileURL = TestFileHelper.fileURLForFile(named: "a", extension: "txt") + let alphaFile = try GraphQLFile(fieldName: "files", + originalName: "a.txt", + mimeType: "text/plain", + fileURL: alphaFileURL) + + let betaFileURL = TestFileHelper.fileURLForFile(named: "b", extension: "txt") + let betaFile = try GraphQLFile(fieldName: "files", + originalName: "b.txt", + mimeType: "text/plain", + fileURL: betaFileURL) + + let files = [alphaFile, betaFile] + let operation = UploadMultipleFilesToTheSameParameterMutation(files: files.map { $0.originalName }) + let transport = try XCTUnwrap(self.client.networkTransport as? RequestChainNetworkTransport) + + let httpRequest = transport.constructUploadRequest(for: operation, + with: [alphaFile, betaFile], + manualBoundary: "TEST.BOUNDARY") + let uploadRequest = try XCTUnwrap(httpRequest as? UploadRequest) + + let urlRequest = try uploadRequest.toURLRequest() + XCTAssertEqual(urlRequest.allHTTPHeaderFields?["headerKey"], "headerValue") + + let multipartData = try uploadRequest.requestMultipartFormData() + let stringToCompare = try multipartData.toTestString() + + let expectedString = """ +--TEST.BOUNDARY +Content-Disposition: form-data; name="operations" + +{"id":"88858c283bb72f18c0049dc85b140e72a4046f469fa16a8bf4bcf01c11d8a2b7","operationName":"UploadMultipleFilesToTheSameParameter","query":"mutation UploadMultipleFilesToTheSameParameter($files: [Upload!]!) {\\n multipleUpload(files: $files) {\\n __typename\\n id\\n path\\n filename\\n mimetype\\n }\\n}","variables":{"files":[null,null]}} +--TEST.BOUNDARY +Content-Disposition: form-data; name="map" + +{"0":["variables.files.0"],"1":["variables.files.1"]} +--TEST.BOUNDARY +Content-Disposition: form-data; name="0"; filename="a.txt" +Content-Type: text/plain + +Alpha file content. + +--TEST.BOUNDARY +Content-Disposition: form-data; name="1"; filename="b.txt" +Content-Type: text/plain + +Bravo file content. + +--TEST.BOUNDARY-- +""" + XCTAssertEqual(stringToCompare, expectedString) + } + + func testMultipleFilesWithMultipleFieldsWithUploadRequest() throws { + let alphaFileURL = TestFileHelper.fileURLForFile(named: "a", extension: "txt") + let alphaFile = try GraphQLFile(fieldName: "uploads", + originalName: "a.txt", + mimeType: "text/plain", + fileURL: alphaFileURL) + + let betaFileURL = TestFileHelper.fileURLForFile(named: "b", extension: "txt") + let betaFile = try GraphQLFile(fieldName: "uploads", + originalName: "b.txt", + mimeType: "text/plain", + fileURL: betaFileURL) + + let charlieFileUrl = TestFileHelper.fileURLForFile(named: "c", extension: "txt") + let charlieFile = try GraphQLFile(fieldName: "secondField", + originalName: "c.txt", + mimeType: "text/plain", + fileURL: charlieFileUrl) + + let transport = try XCTUnwrap(self.client.networkTransport as? RequestChainNetworkTransport) + + let httpRequest = transport.constructUploadRequest(for: HeroNameQuery(), + with: [alphaFile, betaFile, charlieFile], + manualBoundary: "TEST.BOUNDARY") + let uploadRequest = try XCTUnwrap(httpRequest as? UploadRequest) + + let urlRequest = try uploadRequest.toURLRequest() + XCTAssertEqual(urlRequest.allHTTPHeaderFields?["headerKey"], "headerValue") + + let multipartData = try uploadRequest.requestMultipartFormData() + let stringToCompare = try multipartData.toTestString() + + let expectedString = """ +--TEST.BOUNDARY +Content-Disposition: form-data; name="operations" + +{"id":"f6e76545cd03aa21368d9969cb39447f6e836a16717823281803778e7805d671","operationName":"HeroName","query":"query HeroName($episode: Episode) {\\n hero(episode: $episode) {\\n __typename\\n name\\n }\\n}","variables":{"episode":null,\"secondField\":null,\"uploads\":null}} +--TEST.BOUNDARY +Content-Disposition: form-data; name="map" + +{"0":["variables.secondField"],"1":["variables.uploads.0"],"2":["variables.uploads.1"]} +--TEST.BOUNDARY +Content-Disposition: form-data; name="0"; filename="c.txt" +Content-Type: text/plain + +Charlie file content. + +--TEST.BOUNDARY +Content-Disposition: form-data; name="1"; filename="a.txt" +Content-Type: text/plain + +Alpha file content. + +--TEST.BOUNDARY +Content-Disposition: form-data; name="2"; filename="b.txt" +Content-Type: text/plain + +Bravo file content. + +--TEST.BOUNDARY-- +""" + XCTAssertEqual(stringToCompare, expectedString) + } +} diff --git a/Tests/ApolloWebsocketTests/MockWebSocket.swift b/Tests/ApolloTests/WebSocket/MockWebSocket.swift similarity index 100% rename from Tests/ApolloWebsocketTests/MockWebSocket.swift rename to Tests/ApolloTests/WebSocket/MockWebSocket.swift diff --git a/Tests/ApolloWebsocketTests/SplitNetworkTransportTests.swift b/Tests/ApolloTests/WebSocket/SplitNetworkTransportTests.swift similarity index 100% rename from Tests/ApolloWebsocketTests/SplitNetworkTransportTests.swift rename to Tests/ApolloTests/WebSocket/SplitNetworkTransportTests.swift diff --git a/Tests/ApolloWebsocketTests/MockWebSocketTests.swift b/Tests/ApolloTests/WebSocket/WebSocketTests.swift similarity index 98% rename from Tests/ApolloWebsocketTests/MockWebSocketTests.swift rename to Tests/ApolloTests/WebSocket/WebSocketTests.swift index c9f3c9e9af..57e5b24418 100644 --- a/Tests/ApolloWebsocketTests/MockWebSocketTests.swift +++ b/Tests/ApolloTests/WebSocket/WebSocketTests.swift @@ -13,7 +13,7 @@ extension WebSocketTransport { } } -class MockWebSocketTests: XCTestCase { +class WebSocketTests: XCTestCase { var networkTransport: WebSocketTransport! var client: ApolloClient! diff --git a/Tests/ApolloWebsocketTests/WebSocketTransportTests.swift b/Tests/ApolloTests/WebSocket/WebSocketTransportTests.swift similarity index 100% rename from Tests/ApolloWebsocketTests/WebSocketTransportTests.swift rename to Tests/ApolloTests/WebSocket/WebSocketTransportTests.swift diff --git a/Tests/ApolloWebSocket-UnitTestPlan.xctestplan b/Tests/ApolloWebSocket-UnitTestPlan.xctestplan new file mode 100644 index 0000000000..9f1fba606a --- /dev/null +++ b/Tests/ApolloWebSocket-UnitTestPlan.xctestplan @@ -0,0 +1,33 @@ +{ + "configurations" : [ + { + "id" : "02D5FC33-493B-45F5-9563-2FE5B7495F16", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + "codeCoverage" : { + "targets" : [ + { + "containerPath" : "container:Apollo.xcodeproj", + "identifier" : "9B7BDA7C23FDE90400ACD198", + "name" : "ApolloWebSocket" + } + ] + }, + "environmentVariableEntries" : [ + { + "key" : "APOLLO_TEST_CACHE_PROVIDER", + "value" : "ApolloTestSupport.InMemoryTestCacheProvider" + } + ], + "threadSanitizerEnabled" : true + }, + "testTargets" : [ + + ], + "version" : 1 +} diff --git a/Tests/ApolloWebsocketTests/Info.plist b/Tests/ApolloWebsocketTests/Info.plist deleted file mode 100644 index 28165a5b96..0000000000 --- a/Tests/ApolloWebsocketTests/Info.plist +++ /dev/null @@ -1,28 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleDisplayName - ApolloWebSocket - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - $(CURRENT_PROJECT_VERSION) - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - From 311c019196e428b30c1730bf6c7e2f32d610a4f8 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 6 Apr 2021 11:28:00 -0700 Subject: [PATCH 06/30] Convert schemes to use test plans --- Apollo.xcodeproj/project.pbxproj | 8 ++- .../xcschemes/Apollo Playground.xcscheme | 8 ++- .../xcshareddata/xcschemes/Apollo.xcscheme | 6 ++ .../xcschemes/ApolloCodegenLib.xcscheme | 8 ++- .../xcschemes/ApolloCore.xcscheme | 16 ++++- .../xcschemes/ApolloPerformanceTests.xcscheme | 8 ++- .../xcschemes/ApolloSQLite.xcscheme | 8 ++- .../ApolloServerIntegrationTests.xcscheme | 58 +++++++++++++++++++ Tests/Apollo-CITestPlan.xctestplan | 45 ++++++++++++++ Tests/Apollo-CodegenTestPlan.xctestplan | 24 ++++++++ Tests/Apollo-PerformanceTestPlan.xctestplan | 24 ++++++++ Tests/ApolloWebSocket-UnitTestPlan.xctestplan | 33 ----------- 12 files changed, 204 insertions(+), 42 deletions(-) create mode 100644 Apollo.xcodeproj/xcshareddata/xcschemes/ApolloServerIntegrationTests.xcscheme create mode 100644 Tests/Apollo-CITestPlan.xctestplan create mode 100644 Tests/Apollo-CodegenTestPlan.xctestplan create mode 100644 Tests/Apollo-PerformanceTestPlan.xctestplan delete mode 100644 Tests/ApolloWebSocket-UnitTestPlan.xctestplan diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index 36e5850a8d..a4b0e33598 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -812,7 +812,6 @@ DE3C7B14260A6FCA00D2F4FF /* GraphQLEnum.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphQLEnum.swift; sourceTree = ""; }; DE3C7B15260A6FCA00D2F4FF /* ScalarTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScalarTypes.swift; sourceTree = ""; }; DE6B154A261505450068D642 /* GraphQLMap.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GraphQLMap.swift; sourceTree = ""; }; - DE6B15892615294F0068D642 /* ApolloWebSocket-UnitTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "ApolloWebSocket-UnitTestPlan.xctestplan"; sourceTree = ""; }; DE6B15AC26152BE10068D642 /* ApolloServerIntegrationTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ApolloServerIntegrationTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; DE6B15AE26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LegacyInterceptorProviderIntegrationTests.swift; sourceTree = ""; }; DE6B15B026152BE10068D642 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -844,6 +843,9 @@ DED45D842616759C0086EF63 /* TestConfigs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestConfigs.swift; sourceTree = ""; }; DED45DC7261682260086EF63 /* Apollo-UnitTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Apollo-UnitTestPlan.xctestplan"; sourceTree = ""; }; DED45F49261CDBFC0086EF63 /* UploadTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadTests.swift; sourceTree = ""; }; + DED45FB1261CDE7D0086EF63 /* Apollo-PerformanceTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Apollo-PerformanceTestPlan.xctestplan"; sourceTree = ""; }; + DED45FB2261CDE980086EF63 /* Apollo-CITestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Apollo-CITestPlan.xctestplan"; sourceTree = ""; }; + DED45FB3261CDEC60086EF63 /* Apollo-CodegenTestPlan.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = "Apollo-CodegenTestPlan.xctestplan"; sourceTree = ""; }; E86D8E03214B32DA0028EFE1 /* JSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JSONTests.swift; sourceTree = ""; }; F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QueryFromJSONBuildingTests.swift; sourceTree = ""; }; F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AutomaticPersistedQueriesTests.swift; sourceTree = ""; }; @@ -1692,7 +1694,9 @@ children = ( DED45DC7261682260086EF63 /* Apollo-UnitTestPlan.xctestplan */, DED45C3B26165DD70086EF63 /* Apollo-IntegrationTestPlan.xctestplan */, - DE6B15892615294F0068D642 /* ApolloWebSocket-UnitTestPlan.xctestplan */, + DED45FB1261CDE7D0086EF63 /* Apollo-PerformanceTestPlan.xctestplan */, + DED45FB2261CDE980086EF63 /* Apollo-CITestPlan.xctestplan */, + DED45FB3261CDEC60086EF63 /* Apollo-CodegenTestPlan.xctestplan */, 9FC750521D2A532D00458D91 /* ApolloTests */, 9F54C8B5255D760B0065AFD6 /* ApolloPerformanceTests */, 9BAEEC0A234BB95B00808306 /* ApolloCodegenTests */, diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo Playground.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo Playground.xcscheme index 7352fedcf5..b02f13b671 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo Playground.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo Playground.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -82,6 +82,12 @@ ReferencedContainer = "container:Apollo.xcodeproj"> + + + + diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme index c59be33460..e639553a46 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme @@ -60,6 +60,12 @@ reference = "container:Tests/Apollo-UnitTestPlan.xctestplan" default = "YES"> + + + + + version = "1.7"> @@ -55,6 +55,12 @@ ReferencedContainer = "container:Apollo.xcodeproj"> + + + + diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloCore.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloCore.xcscheme index 8da2d49ffe..e4643d5336 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloCore.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloCore.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -27,8 +27,18 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> - - + + + + + + + + + version = "1.7"> @@ -12,6 +12,12 @@ selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES" disableMainThreadChecker = "YES"> + + + + diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme index 78a4a2c6f0..661ccf1573 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme @@ -1,7 +1,7 @@ + version = "1.7"> @@ -46,6 +46,12 @@ ReferencedContainer = "container:Apollo.xcodeproj"> + + + + diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloServerIntegrationTests.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloServerIntegrationTests.xcscheme new file mode 100644 index 0000000000..3b18b03e5e --- /dev/null +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloServerIntegrationTests.xcscheme @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/Apollo-CITestPlan.xctestplan b/Tests/Apollo-CITestPlan.xctestplan new file mode 100644 index 0000000000..ea41bb0342 --- /dev/null +++ b/Tests/Apollo-CITestPlan.xctestplan @@ -0,0 +1,45 @@ +{ + "configurations" : [ + { + "id" : "8B27E3A2-3A52-417E-9598-1FF14D3F8C84", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:Apollo.xcodeproj", + "identifier" : "9BAEEBFB234BB8FD00808306", + "name" : "ApolloCodegenTests" + } + }, + { + "target" : { + "containerPath" : "container:Apollo.xcodeproj", + "identifier" : "9F54C8B3255D760B0065AFD6", + "name" : "ApolloPerformanceTests" + } + }, + { + "target" : { + "containerPath" : "container:Apollo.xcodeproj", + "identifier" : "DE6B15AB26152BE10068D642", + "name" : "ApolloServerIntegrationTests" + } + }, + { + "target" : { + "containerPath" : "container:Apollo.xcodeproj", + "identifier" : "9FC7504D1D2A532D00458D91", + "name" : "ApolloTests" + } + } + ], + "version" : 1 +} diff --git a/Tests/Apollo-CodegenTestPlan.xctestplan b/Tests/Apollo-CodegenTestPlan.xctestplan new file mode 100644 index 0000000000..2a117aa0f2 --- /dev/null +++ b/Tests/Apollo-CodegenTestPlan.xctestplan @@ -0,0 +1,24 @@ +{ + "configurations" : [ + { + "id" : "7BBE4BEB-2608-4818-AB40-1149E12C6785", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:Apollo.xcodeproj", + "identifier" : "9BAEEBFB234BB8FD00808306", + "name" : "ApolloCodegenTests" + } + } + ], + "version" : 1 +} diff --git a/Tests/Apollo-PerformanceTestPlan.xctestplan b/Tests/Apollo-PerformanceTestPlan.xctestplan new file mode 100644 index 0000000000..f2b1b7a04e --- /dev/null +++ b/Tests/Apollo-PerformanceTestPlan.xctestplan @@ -0,0 +1,24 @@ +{ + "configurations" : [ + { + "id" : "72DF6CB1-DEC6-49C8-91E1-2EE002E10612", + "name" : "Configuration 1", + "options" : { + + } + } + ], + "defaultOptions" : { + + }, + "testTargets" : [ + { + "target" : { + "containerPath" : "container:Apollo.xcodeproj", + "identifier" : "9F54C8B3255D760B0065AFD6", + "name" : "ApolloPerformanceTests" + } + } + ], + "version" : 1 +} diff --git a/Tests/ApolloWebSocket-UnitTestPlan.xctestplan b/Tests/ApolloWebSocket-UnitTestPlan.xctestplan deleted file mode 100644 index 9f1fba606a..0000000000 --- a/Tests/ApolloWebSocket-UnitTestPlan.xctestplan +++ /dev/null @@ -1,33 +0,0 @@ -{ - "configurations" : [ - { - "id" : "02D5FC33-493B-45F5-9563-2FE5B7495F16", - "name" : "Configuration 1", - "options" : { - - } - } - ], - "defaultOptions" : { - "codeCoverage" : { - "targets" : [ - { - "containerPath" : "container:Apollo.xcodeproj", - "identifier" : "9B7BDA7C23FDE90400ACD198", - "name" : "ApolloWebSocket" - } - ] - }, - "environmentVariableEntries" : [ - { - "key" : "APOLLO_TEST_CACHE_PROVIDER", - "value" : "ApolloTestSupport.InMemoryTestCacheProvider" - } - ], - "threadSanitizerEnabled" : true - }, - "testTargets" : [ - - ], - "version" : 1 -} From 11dfb368be1c097a3f898ad409b13f91679d430e Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 6 Apr 2021 11:37:05 -0700 Subject: [PATCH 07/30] Reconfigure CircleCI config --- .circleci/config.yml | 79 ++----------------- .../xcshareddata/xcschemes/Apollo.xcscheme | 39 +-------- Tests/Apollo-CITestPlan.xctestplan | 11 +-- 3 files changed, 11 insertions(+), 118 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5641278c14..bd4c9c8431 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ commands: command: xcodebuild clean build build-for-testing -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" | xcpretty name: Clean and build for testing - run: - command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" | xcpretty + command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" --testplan "${CIRCLE_XCODE_TEST_PLAN}" | xcpretty name: Run tests - save-xcodebuild-artifacts - save_cache: @@ -100,6 +100,7 @@ jobs: environment: DESTINATION: platform=macOS,arch=x86_64 CIRCLE_XCODE_SCHEME: Apollo + CIRCLE_XCODE_TEST_PLAN: Apollo-CITestPlan CIRCLE_XCODE_SDK: << pipeline.parameters.macos_sdk >> steps: - common_test_steps @@ -110,6 +111,7 @@ jobs: environment: DESTINATION: platform=iOS Simulator,OS=<< pipeline.parameters.ios_current_version >>,name=iPhone 11 CIRCLE_XCODE_SCHEME: Apollo + CIRCLE_XCODE_TEST_PLAN: Apollo-CITestPlan CIRCLE_XCODE_SDK: << pipeline.parameters.ios_sdk >> steps: - common_test_steps @@ -120,6 +122,7 @@ jobs: environment: DESTINATION: platform=iOS Simulator,OS=<< pipeline.parameters.ios_previous_version >>,name=iPhone 11 CIRCLE_XCODE_SCHEME: Apollo + CIRCLE_XCODE_TEST_PLAN: Apollo-CITestPlan CIRCLE_XCODE_SDK: << pipeline.parameters.ios_sdk >> steps: - common_test_steps @@ -130,76 +133,18 @@ jobs: environment: DESTINATION: platform=tvOS Simulator,OS=<< pipeline.parameters.tvos_version >>,name=Apple TV CIRCLE_XCODE_SCHEME: Apollo + CIRCLE_XCODE_TEST_PLAN: Apollo-CITestPlan CIRCLE_XCODE_SDK: << pipeline.parameters.tvos_sdk >> steps: - common_test_steps - SQLitemacOS_current: - macos: - xcode: << pipeline.parameters.xcode_version >> - environment: - DESTINATION: platform=macOS,arch=x86_64 - CIRCLE_XCODE_SCHEME: ApolloSQLite - CIRCLE_XCODE_SDK: << pipeline.parameters.macos_sdk >> - steps: - - common_test_steps - - SQLiteiOS_current: - macos: - xcode: << pipeline.parameters.xcode_version >> - environment: - DESTINATION: platform=iOS Simulator,OS=<< pipeline.parameters.ios_current_version >>,name=iPhone 11 - CIRCLE_XCODE_SCHEME: ApolloSQLite - CIRCLE_XCODE_SDK: << pipeline.parameters.ios_sdk >> - steps: - - common_test_steps - - SQLiteiOS_previous: - macos: - xcode: << pipeline.parameters.xcode_version >> - environment: - DESTINATION: platform=iOS Simulator,OS=<< pipeline.parameters.ios_previous_version >>,name=iPhone 11 - CIRCLE_XCODE_SCHEME: ApolloSQLite - CIRCLE_XCODE_SDK: << pipeline.parameters.ios_sdk >> - steps: - - common_test_steps - - WebSocketmacOS_current: - macos: - xcode: << pipeline.parameters.xcode_version >> - environment: - DESTINATION: platform=macOS,arch=x86_64 - CIRCLE_XCODE_SCHEME: ApolloWebSocket - CIRCLE_XCODE_SDK: << pipeline.parameters.macos_sdk >> - steps: - - common_test_steps - - WebSocketiOS_current: - macos: - xcode: << pipeline.parameters.xcode_version >> - environment: - DESTINATION: platform=iOS Simulator,OS=<< pipeline.parameters.ios_current_version >>,name=iPhone 11 - CIRCLE_XCODE_SCHEME: ApolloWebSocket - CIRCLE_XCODE_SDK: << pipeline.parameters.ios_sdk >> - steps: - - common_test_steps - - WebSocketiOS_previous: - macos: - xcode: << pipeline.parameters.xcode_version >> - environment: - DESTINATION: platform=iOS Simulator,OS=<< pipeline.parameters.ios_previous_version >>,name=iPhone 11 - CIRCLE_XCODE_SCHEME: ApolloWebSocket - CIRCLE_XCODE_SDK: << pipeline.parameters.ios_sdk >> - steps: - - common_test_steps - CodegenLibmacOS_current: macos: xcode: << pipeline.parameters.xcode_version >> environment: DESTINATION: platform=macOS,arch=x86_64 CIRCLE_XCODE_SCHEME: ApolloCodegenLib + CIRCLE_XCODE_TEST_PLAN: Apollo-CodegenTestPlan CIRCLE_XCODE_SDK: << pipeline.parameters.macos_sdk >> steps: - common_test_steps @@ -228,18 +173,6 @@ workflows: name: Apollo iOS << pipeline.parameters.ios_previous_version >> - tvOS_current: name: Apollo tvOS << pipeline.parameters.tvos_version >> - - SQLitemacOS_current: - name: ApolloSQLite macOS << pipeline.parameters.macos_version >> - - SQLiteiOS_current: - name: ApolloSQLite iOS << pipeline.parameters.ios_current_version >> - - SQLiteiOS_previous: - name: ApolloSQLite iOS << pipeline.parameters.ios_previous_version >> - - WebSocketmacOS_current: - name: ApolloWebSocket macOS << pipeline.parameters.macos_version >> - - WebSocketiOS_current: - name: ApolloWebSocket iOS << pipeline.parameters.ios_current_version >> - - WebSocketiOS_previous: - name: ApolloWebSocket iOS << pipeline.parameters.ios_previous_version >> - CodegenLibmacOS_current: name: Swift Code Generation - CocoaPodsTrunk: diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme index e639553a46..ea69c57e48 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo.xcscheme @@ -66,6 +66,9 @@ + + - - - - - - - - - - - - - - - - - - - - - - Date: Tue, 6 Apr 2021 11:41:02 -0700 Subject: [PATCH 08/30] minor fix for CircleCI config --- .circleci/config.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index bd4c9c8431..328737c3db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -182,12 +182,6 @@ workflows: - Apollo iOS << pipeline.parameters.ios_current_version >> - Apollo iOS << pipeline.parameters.ios_previous_version >> - Apollo tvOS << pipeline.parameters.tvos_version >> - - ApolloSQLite macOS << pipeline.parameters.macos_version >> - - ApolloSQLite iOS << pipeline.parameters.ios_current_version >> - - ApolloSQLite iOS << pipeline.parameters.ios_previous_version >> - - ApolloWebSocket macOS << pipeline.parameters.macos_version >> - - ApolloWebSocket iOS << pipeline.parameters.ios_current_version >> - - ApolloWebSocket iOS << pipeline.parameters.ios_previous_version >> - Swift Code Generation filters: # Only build semver tags From bd8eec84a3c0751ab53d2aad67be11809d60abd3 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 6 Apr 2021 12:34:14 -0700 Subject: [PATCH 09/30] Fixes for broken test imports --- Apollo.xcodeproj/project.pbxproj | 106 +++++++++++++++--- .../ApolloTestSupport}/MockWebSocket.swift | 20 ++-- .../ApolloTestSupport}/Resources/a.txt | 0 .../ApolloTestSupport}/Resources/b.txt | 0 .../ApolloTestSupport}/Resources/c.txt | 0 .../ApolloTestSupport}/TestFileHelper.swift | 10 +- Sources/ApolloTestSupport/TestURLs.swift | 12 +- ...yInterceptorProviderIntegrationTests.swift | 1 + .../StarWarsServerCachingRoundtripTests.swift | 3 +- .../StarWarsServerTests.swift | 1 - .../StarWarsSubscriptionTests.swift | 6 +- .../StarWarsWebSocketTests.swift | 2 +- .../TestHelpers}/HTTPBinAPI.swift | 0 .../TestHelpers/TestServerURLs.swift | 2 + .../UploadTests.swift | 2 +- .../AutomaticPersistedQueriesTests.swift | 2 +- Tests/ApolloTests/GETTransformerTests.swift | 2 +- Tests/ApolloTests/GraphQLFileTests.swift | 1 + .../ApolloTests/MultipartFormDataTests.swift | 1 + .../SplitNetworkTransportTests.swift | 2 +- 20 files changed, 119 insertions(+), 54 deletions(-) rename {Tests/ApolloTests/WebSocket => Sources/ApolloTestSupport}/MockWebSocket.swift (73%) rename {Tests/ApolloTests => Sources/ApolloTestSupport}/Resources/a.txt (100%) rename {Tests/ApolloTests => Sources/ApolloTestSupport}/Resources/b.txt (100%) rename {Tests/ApolloTests => Sources/ApolloTestSupport}/Resources/c.txt (100%) rename {Tests/ApolloTests => Sources/ApolloTestSupport}/TestFileHelper.swift (69%) rename Tests/{ApolloTests => ApolloServerIntegrationTests/TestHelpers}/HTTPBinAPI.swift (100%) diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index a4b0e33598..77c60fa31a 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -15,11 +15,7 @@ 9B0E471C240B167C0093BDA7 /* String+Apollo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B0E471B240B167C0093BDA7 /* String+Apollo.swift */; }; 9B0E471E240B239D0093BDA7 /* ASTEnumValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B0E471D240B239D0093BDA7 /* ASTEnumValue.swift */; }; 9B1CCDD92360F02C007C9032 /* Bundle+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B1CCDD82360F02C007C9032 /* Bundle+Helpers.swift */; }; - 9B20611A2591B3550020D1E0 /* c.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061172591B3550020D1E0 /* c.txt */; }; - 9B20611B2591B3550020D1E0 /* b.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061182591B3550020D1E0 /* b.txt */; }; - 9B20611C2591B3550020D1E0 /* a.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061192591B3550020D1E0 /* a.txt */; }; 9B21FD752422C29D00998B5C /* GraphQLFileTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B21FD742422C29D00998B5C /* GraphQLFileTests.swift */; }; - 9B21FD772422C8CC00998B5C /* TestFileHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B21FD762422C8CC00998B5C /* TestFileHelper.swift */; }; 9B21FD782424305700998B5C /* ExpectedEnumWithDifferentCases.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B68F05F2416F80C00E97318 /* ExpectedEnumWithDifferentCases.swift */; }; 9B21FD792424305E00998B5C /* ExpectedEnumWithSanitizedCases.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B68F063241703B200E97318 /* ExpectedEnumWithSanitizedCases.swift */; }; 9B260BEB245A020300562176 /* ApolloInterceptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B260BEA245A020300562176 /* ApolloInterceptor.swift */; }; @@ -64,7 +60,6 @@ 9B47518D2575AA850001FB87 /* Pluralizer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B47516D2575AA690001FB87 /* Pluralizer.swift */; }; 9B4751AD2575B5070001FB87 /* PluralizerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4751AC2575B5070001FB87 /* PluralizerTests.swift */; }; 9B4F453F244A27B900C2CF7D /* URLSessionClient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F453E244A27B900C2CF7D /* URLSessionClient.swift */; }; - 9B4F4541244A2A9200C2CF7D /* HTTPBinAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F4540244A2A9200C2CF7D /* HTTPBinAPI.swift */; }; 9B518C87235F819E004C426D /* CLIDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B518C85235F8125004C426D /* CLIDownloader.swift */; }; 9B518C8C235F8B5F004C426D /* ApolloFilePathHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B518C8A235F8B05004C426D /* ApolloFilePathHelper.swift */; }; 9B518C8D235F8B9E004C426D /* CLIDownloaderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B518C88235F8AD4004C426D /* CLIDownloaderTests.swift */; }; @@ -255,10 +250,12 @@ DE3C7B1B260A6FCA00D2F4FF /* ScalarTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE3C7B15260A6FCA00D2F4FF /* ScalarTypes.swift */; }; DE3C7B4A260A73D800D2F4FF /* AnimalKingdomAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = DE3C79A9260A6ACD00D2F4FF /* AnimalKingdomAPI.h */; settings = {ATTRIBUTES = (Public, ); }; }; DE3C7B4B260A73F900D2F4FF /* schema.graphqls in Resources */ = {isa = PBXBuildFile; fileRef = DE3C7AB9260A6D3E00D2F4FF /* schema.graphqls */; }; + DE674D9D261CEEE4000E8FC8 /* c.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061172591B3550020D1E0 /* c.txt */; }; + DE674D9E261CEEE4000E8FC8 /* b.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061182591B3550020D1E0 /* b.txt */; }; + DE674D9F261CEEE4000E8FC8 /* a.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061192591B3550020D1E0 /* a.txt */; }; DE6B156A261505660068D642 /* GraphQLMap.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6B154A261505450068D642 /* GraphQLMap.swift */; }; DE6B15AF26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE6B15AE26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift */; }; DE6B15B126152BE10068D642 /* Apollo.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FC750441D2A532C00458D91 /* Apollo.framework */; }; - DED45C182615308E0086EF63 /* TestServerURLs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45C172615308E0086EF63 /* TestServerURLs.swift */; }; DED45C2A2615319E0086EF63 /* LegacyInterceptorProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45C292615319E0086EF63 /* LegacyInterceptorProviderTests.swift */; }; DED45D73261675890086EF63 /* StarWarsServerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FA6ABC91EC0A9F7000017BE /* StarWarsServerTests.swift */; }; DED45D852616759C0086EF63 /* TestConfigs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45D842616759C0086EF63 /* TestConfigs.swift */; }; @@ -274,7 +271,6 @@ DED45E6B261B9EAC0086EF63 /* SQLiteTestCacheProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDAEC23FDED9700ACD198 /* SQLiteTestCacheProvider.swift */; }; DED45EC3261BA0ED0086EF63 /* WebSocketTransportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D90F1AF92479DEE5007A1534 /* WebSocketTransportTests.swift */; }; DED45EC4261BA0ED0086EF63 /* SplitNetworkTransportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8A23FDE92900ACD198 /* SplitNetworkTransportTests.swift */; }; - DED45EC5261BA0ED0086EF63 /* MockWebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8723FDE92900ACD198 /* MockWebSocket.swift */; }; DED45EC7261BA0ED0086EF63 /* WebSocketTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8923FDE92900ACD198 /* WebSocketTests.swift */; }; DED45EE4261BA1FB0086EF63 /* ApolloSQLite.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDABF23FDEBB600ACD198 /* ApolloSQLite.framework */; }; DED45EE5261BA1FB0086EF63 /* ApolloWebSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDA7D23FDE90400ACD198 /* ApolloWebSocket.framework */; }; @@ -282,6 +278,14 @@ DED45F17261CDA360086EF63 /* StarWarsWebSocketTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8C23FDE92900ACD198 /* StarWarsWebSocketTests.swift */; }; DED45F30261CDB560086EF63 /* URLSessionClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F4542244A2AD300C2CF7D /* URLSessionClientTests.swift */; }; DED45F4A261CDBFC0086EF63 /* UploadTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45F49261CDBFC0086EF63 /* UploadTests.swift */; }; + DED45FD0261CE88C0086EF63 /* ApolloSQLite.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDABF23FDEBB600ACD198 /* ApolloSQLite.framework */; }; + DED45FE7261CE8C50086EF63 /* ApolloWebSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B7BDA7D23FDE90400ACD198 /* ApolloWebSocket.framework */; }; + DED46000261CE9080086EF63 /* HTTPBinAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B4F4540244A2A9200C2CF7D /* HTTPBinAPI.swift */; }; + DED4600D261CE9260086EF63 /* TestFileHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B21FD762422C8CC00998B5C /* TestFileHelper.swift */; }; + DED4601A261CE9880086EF63 /* MockWebSocket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B7BDA8723FDE92900ACD198 /* MockWebSocket.swift */; }; + DED46035261CEA660086EF63 /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; }; + DED46042261CEA8A0086EF63 /* TestServerURLs.swift in Sources */ = {isa = PBXBuildFile; fileRef = DED45C172615308E0086EF63 /* TestServerURLs.swift */; }; + DED46051261CEAD20086EF63 /* StarWarsAPI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9FCE2CFA1E6C213D00E34457 /* StarWarsAPI.framework */; }; E86D8E05214B32FD0028EFE1 /* JSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E86D8E03214B32DA0028EFE1 /* JSONTests.swift */; }; F16D083C21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F16D083B21EF6F7300C458B8 /* QueryFromJSONBuildingTests.swift */; }; F82E62E122BCD223000C311B /* AutomaticPersistedQueriesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F82E62E022BCD223000C311B /* AutomaticPersistedQueriesTests.swift */; }; @@ -449,6 +453,34 @@ remoteGlobalIDString = 9B7BDA7C23FDE90400ACD198; remoteInfo = ApolloWebSocket; }; + DED45FCE261CE8890086EF63 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9B7BDABE23FDEBB600ACD198; + remoteInfo = ApolloSQLite; + }; + DED45FD5261CE89C0086EF63 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9B7BDA7C23FDE90400ACD198; + remoteInfo = ApolloWebSocket; + }; + DED46033261CEA610086EF63 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9F8A95771EC0FC1200304A2D; + remoteInfo = ApolloTestSupport; + }; + DED4606A261CEDD10086EF63 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9FCE2CF91E6C213D00E34457; + remoteInfo = StarWarsAPI; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -962,6 +994,10 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DED46051261CEAD20086EF63 /* StarWarsAPI.framework in Frameworks */, + DED46035261CEA660086EF63 /* ApolloTestSupport.framework in Frameworks */, + DED45FE7261CE8C50086EF63 /* ApolloWebSocket.framework in Frameworks */, + DED45FD0261CE88C0086EF63 /* ApolloSQLite.framework in Frameworks */, DE6B15B126152BE10068D642 /* Apollo.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1011,12 +1047,10 @@ children = ( 9BC139A524EDCAD900876D29 /* BlindRetryingTestInterceptor.swift */, 9B2B66F32513FAFE00B53ABF /* CancellationHandlingInterceptor.swift */, - 9B4F4540244A2A9200C2CF7D /* HTTPBinAPI.swift */, 9BF6C91725194D7B000D5B93 /* MultipartFormData+Testing.swift */, 9BC139A724EDCE4F00876D29 /* RetryToCountThenSucceedInterceptor.swift */, 9BF6C99B25195019000D5B93 /* String+IncludesForTesting.swift */, C3279FC52345233000224790 /* TestCustomRequestBodyCreator.swift */, - 9B21FD762422C8CC00998B5C /* TestFileHelper.swift */, 9B64F6752354D219002D1BB5 /* URL+QueryDict.swift */, ); name = TestHelpers; @@ -1402,13 +1436,16 @@ 9BCF0CDE23FC9CA50031D2A2 /* Info.plist */, 9BCF0CDD23FC9CA50031D2A2 /* MockURLSession.swift */, 9BCF0CDF23FC9CA50031D2A2 /* MockNetworkTransport.swift */, + 9B7BDA8723FDE92900ACD198 /* MockWebSocket.swift */, 9F3910262549741400AF54A6 /* MockGraphQLServer.swift */, + 9B21FD762422C8CC00998B5C /* TestFileHelper.swift */, 9BCF0CD923FC9CA50031D2A2 /* TestCacheProvider.swift */, 9B7BDAEC23FDED9700ACD198 /* SQLiteTestCacheProvider.swift */, 9BEEDC2A24E61995001D1294 /* TestURLs.swift */, 9BCF0CDC23FC9CA50031D2A2 /* XCTAssertHelpers.swift */, 9FBE0D3F25407B64002ED0B1 /* AsyncResultObserver.swift */, 9F68F9F025415827004F26D0 /* XCTestCase+Helpers.swift */, + 9B2061162591B3550020D1E0 /* Resources */, ); name = ApolloTestSupport; path = Sources/ApolloTestSupport; @@ -1638,7 +1675,6 @@ C338DF1622DD9DE9006AF33E /* RequestBodyCreatorTests.swift */, 9B9BBB1A24DB75E60021C30F /* UploadRequestTests.swift */, 5BB2C0222380836100774170 /* VersionNumberTests.swift */, - 9B2061162591B3550020D1E0 /* Resources */, ); path = ApolloTests; sourceTree = ""; @@ -1825,6 +1861,7 @@ DED45D62261675620086EF63 /* TestHelpers */ = { isa = PBXGroup; children = ( + 9B4F4540244A2A9200C2CF7D /* HTTPBinAPI.swift */, DED45C172615308E0086EF63 /* TestServerURLs.swift */, DED45D842616759C0086EF63 /* TestConfigs.swift */, ); @@ -1857,7 +1894,6 @@ DED45E9B261BA0CA0086EF63 /* WebSocket */ = { isa = PBXGroup; children = ( - 9B7BDA8723FDE92900ACD198 /* MockWebSocket.swift */, 9B7BDA8923FDE92900ACD198 /* WebSocketTests.swift */, 9B7BDA8A23FDE92900ACD198 /* SplitNetworkTransportTests.swift */, D90F1AF92479DEE5007A1534 /* WebSocketTransportTests.swift */, @@ -2102,6 +2138,7 @@ 9F8A95731EC0FC1200304A2D /* Sources */, 9F8A95741EC0FC1200304A2D /* Frameworks */, 9F8A95751EC0FC1200304A2D /* Headers */, + DE674D9C261CEEDA000E8FC8 /* Resources */, ); buildRules = ( ); @@ -2230,9 +2267,15 @@ buildRules = ( ); dependencies = ( + DED46034261CEA610086EF63 /* PBXTargetDependency */, + DED45FCF261CE8890086EF63 /* PBXTargetDependency */, + DED45FD6261CE89C0086EF63 /* PBXTargetDependency */, DE6B15B326152BE10068D642 /* PBXTargetDependency */, + DED4606B261CEDD10086EF63 /* PBXTargetDependency */, ); name = ApolloServerIntegrationTests; + packageProductDependencies = ( + ); productName = ApolloServerIntegrationTests; productReference = DE6B15AC26152BE10068D642 /* ApolloServerIntegrationTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -2409,9 +2452,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9B20611C2591B3550020D1E0 /* a.txt in Resources */, - 9B20611A2591B3550020D1E0 /* c.txt in Resources */, - 9B20611B2591B3550020D1E0 /* b.txt in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2423,6 +2463,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + DE674D9C261CEEDA000E8FC8 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + DE674D9F261CEEE4000E8FC8 /* a.txt in Resources */, + DE674D9E261CEEE4000E8FC8 /* b.txt in Resources */, + DE674D9D261CEEE4000E8FC8 /* c.txt in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; DE6B15AA26152BE10068D642 /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -2646,11 +2696,13 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + DED4601A261CE9880086EF63 /* MockWebSocket.swift in Sources */, 9BCF0CE423FC9CA50031D2A2 /* MockURLSession.swift in Sources */, 9FBE0D4025407B64002ED0B1 /* AsyncResultObserver.swift in Sources */, 9F3910272549741400AF54A6 /* MockGraphQLServer.swift in Sources */, DED45E6B261B9EAC0086EF63 /* SQLiteTestCacheProvider.swift in Sources */, 9BEEDC2B24E61995001D1294 /* TestURLs.swift in Sources */, + DED4600D261CE9260086EF63 /* TestFileHelper.swift in Sources */, 9BCF0CE023FC9CA50031D2A2 /* TestCacheProvider.swift in Sources */, 9BCF0CE323FC9CA50031D2A2 /* XCTAssertHelpers.swift in Sources */, 9F68F9F125415827004F26D0 /* XCTestCase+Helpers.swift in Sources */, @@ -2695,7 +2747,6 @@ 54DDB0921EA045870009DD99 /* InMemoryNormalizedCache.swift in Sources */, 9FC9A9C51E2D6CE70023C4D5 /* GraphQLSelectionSet.swift in Sources */, DE6B156A261505660068D642 /* GraphQLMap.swift in Sources */, - DED45C182615308E0086EF63 /* TestServerURLs.swift in Sources */, 9B554CC4247DC29A002F452A /* TaskData.swift in Sources */, 9B9BBAF524DB4F890021C30F /* AutomaticPersistedQueryInterceptor.swift in Sources */, 9BA1244A22D8A8EA00BF1D24 /* JSONSerialization+Sorting.swift in Sources */, @@ -2748,7 +2799,6 @@ DED45EC7261BA0ED0086EF63 /* WebSocketTests.swift in Sources */, 9FC9A9C81E2EFE6E0023C4D5 /* CacheKeyForFieldTests.swift in Sources */, 9BF6C99C25195019000D5B93 /* String+IncludesForTesting.swift in Sources */, - DED45EC5261BA0ED0086EF63 /* MockWebSocket.swift in Sources */, DED45DEF261B96B70086EF63 /* ReadWriteFromStoreTests.swift in Sources */, 9F91CF8F1F6C0DB2008DD0BE /* MutatingResultsTests.swift in Sources */, 9B9BBB1C24DB760B0021C30F /* UploadRequestTests.swift in Sources */, @@ -2764,7 +2814,6 @@ D87AC09F2564D60B0079FAA5 /* ApolloClientOperationTests.swift in Sources */, 9B64F6762354D219002D1BB5 /* URL+QueryDict.swift in Sources */, 9B2B66F42513FAFE00B53ABF /* CancellationHandlingInterceptor.swift in Sources */, - 9B21FD772422C8CC00998B5C /* TestFileHelper.swift in Sources */, 9BC139A624EDCAD900876D29 /* BlindRetryingTestInterceptor.swift in Sources */, 9B96500A24BE62B7003C29C0 /* RequestChainTests.swift in Sources */, DED45DEA261B96B70086EF63 /* WatchQueryTests.swift in Sources */, @@ -2785,7 +2834,6 @@ 9FF90A731DDDEB420034C3B6 /* ParseQueryResponseTests.swift in Sources */, DED45DE9261B96B70086EF63 /* LoadQueryFromStoreTests.swift in Sources */, 9BF6C94325194DE2000D5B93 /* MultipartFormData+Testing.swift in Sources */, - 9B4F4541244A2A9200C2CF7D /* HTTPBinAPI.swift in Sources */, 9F21735B2568F3E200566121 /* PossiblyDeferredTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -2809,10 +2857,12 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + DED46042261CEA8A0086EF63 /* TestServerURLs.swift in Sources */, DED45EFE261CDA2A0086EF63 /* StarWarsSubscriptionTests.swift in Sources */, DED45D852616759C0086EF63 /* TestConfigs.swift in Sources */, DED45D9626167F020086EF63 /* StarWarsServerCachingRoundtripTests.swift in Sources */, DE6B15AF26152BE10068D642 /* LegacyInterceptorProviderIntegrationTests.swift in Sources */, + DED46000261CE9080086EF63 /* HTTPBinAPI.swift in Sources */, DED45F4A261CDBFC0086EF63 /* UploadTests.swift in Sources */, DED45F17261CDA360086EF63 /* StarWarsWebSocketTests.swift in Sources */, DED45D73261675890086EF63 /* StarWarsServerTests.swift in Sources */, @@ -2950,6 +3000,26 @@ target = 9B7BDA7C23FDE90400ACD198 /* ApolloWebSocket */; targetProxy = DED45E99261B9F000086EF63 /* PBXContainerItemProxy */; }; + DED45FCF261CE8890086EF63 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9B7BDABE23FDEBB600ACD198 /* ApolloSQLite */; + targetProxy = DED45FCE261CE8890086EF63 /* PBXContainerItemProxy */; + }; + DED45FD6261CE89C0086EF63 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9B7BDA7C23FDE90400ACD198 /* ApolloWebSocket */; + targetProxy = DED45FD5261CE89C0086EF63 /* PBXContainerItemProxy */; + }; + DED46034261CEA610086EF63 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9F8A95771EC0FC1200304A2D /* ApolloTestSupport */; + targetProxy = DED46033261CEA610086EF63 /* PBXContainerItemProxy */; + }; + DED4606B261CEDD10086EF63 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9FCE2CF91E6C213D00E34457 /* StarWarsAPI */; + targetProxy = DED4606A261CEDD10086EF63 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ diff --git a/Tests/ApolloTests/WebSocket/MockWebSocket.swift b/Sources/ApolloTestSupport/MockWebSocket.swift similarity index 73% rename from Tests/ApolloTests/WebSocket/MockWebSocket.swift rename to Sources/ApolloTestSupport/MockWebSocket.swift index 38f90b8a44..878f1a7da1 100644 --- a/Tests/ApolloTests/WebSocket/MockWebSocket.swift +++ b/Sources/ApolloTestSupport/MockWebSocket.swift @@ -1,25 +1,23 @@ import Starscream import Foundation -import ApolloTestSupport @testable import ApolloWebSocket -class MockWebSocket: ApolloWebSocketClient { +public class MockWebSocket: ApolloWebSocketClient { - var callbackQueue: DispatchQueue = DispatchQueue.main + public var callbackQueue: DispatchQueue = DispatchQueue.main // A dummy web socket since we can't just return the client var webSocketForDelegate: WebSocket - var request: URLRequest + public var request: URLRequest - required init(request: URLRequest, + public required init(request: URLRequest, certPinner: CertificatePinning? = FoundationSecurity(), compressionHandler: CompressionHandler? = nil) { self.webSocketForDelegate = WebSocket(request: request) self.request = request } - public init() { - let request = URLRequest(url: TestURL.starWarsServer.url) + public init(request: URLRequest) { self.request = request self.webSocketForDelegate = WebSocket(request: request) } @@ -48,12 +46,12 @@ class MockWebSocket: ApolloWebSocketClient { open func write(pong: Data, completion: (() -> ())?) { } - func disconnect(closeCode: UInt16) { + public func disconnect(closeCode: UInt16) { } - var delegate: WebSocketDelegate? = nil - var isConnected: Bool = false + public var delegate: WebSocketDelegate? = nil + public var isConnected: Bool = false - func connect() { + public func connect() { } } diff --git a/Tests/ApolloTests/Resources/a.txt b/Sources/ApolloTestSupport/Resources/a.txt similarity index 100% rename from Tests/ApolloTests/Resources/a.txt rename to Sources/ApolloTestSupport/Resources/a.txt diff --git a/Tests/ApolloTests/Resources/b.txt b/Sources/ApolloTestSupport/Resources/b.txt similarity index 100% rename from Tests/ApolloTests/Resources/b.txt rename to Sources/ApolloTestSupport/Resources/b.txt diff --git a/Tests/ApolloTests/Resources/c.txt b/Sources/ApolloTestSupport/Resources/c.txt similarity index 100% rename from Tests/ApolloTests/Resources/c.txt rename to Sources/ApolloTestSupport/Resources/c.txt diff --git a/Tests/ApolloTests/TestFileHelper.swift b/Sources/ApolloTestSupport/TestFileHelper.swift similarity index 69% rename from Tests/ApolloTests/TestFileHelper.swift rename to Sources/ApolloTestSupport/TestFileHelper.swift index 162c636080..f675744a33 100644 --- a/Tests/ApolloTests/TestFileHelper.swift +++ b/Sources/ApolloTestSupport/TestFileHelper.swift @@ -9,9 +9,9 @@ import Foundation import Apollo -struct TestFileHelper { +public struct TestFileHelper { - static func testParentFolder(for file: StaticString = #file) -> URL { + public static func testParentFolder(for file: StaticString = #file) -> URL { let fileAsString = file.withUTF8Buffer { String(decoding: $0, as: UTF8.self) } @@ -19,19 +19,19 @@ struct TestFileHelper { return url.deletingLastPathComponent() } - static func uploadServerFolder(from file: StaticString = #file) -> URL { + public static func uploadServerFolder(from file: StaticString = #file) -> URL { self.testParentFolder(for: file) .deletingLastPathComponent() // test root .deletingLastPathComponent() // source root .appendingPathComponent("SimpleUploadServer") } - static func uploadsFolder(from file: StaticString = #file) -> URL { + public static func uploadsFolder(from file: StaticString = #file) -> URL { self.uploadServerFolder(from: file) .appendingPathComponent("uploads") } - static func fileURLForFile(named name: String, extension fileExtension: String) -> URL { + public static func fileURLForFile(named name: String, extension fileExtension: String) -> URL { return self.testParentFolder() .appendingPathComponent("Resources") .appendingPathComponent(name) diff --git a/Sources/ApolloTestSupport/TestURLs.swift b/Sources/ApolloTestSupport/TestURLs.swift index 655f222bf6..4b1a886050 100644 --- a/Sources/ApolloTestSupport/TestURLs.swift +++ b/Sources/ApolloTestSupport/TestURLs.swift @@ -3,21 +3,15 @@ import Foundation /// URLs used in testing public enum TestURL { case mockServer - case starWarsServer - case starWarsWebSocket - case uploadServer + case mockPort8080 public var url: URL { let urlString: String switch self { - case .starWarsServer: - urlString = "http://localhost:8080/graphql" - case .starWarsWebSocket: - urlString = "ws://localhost:8080/websocket" - case .uploadServer: - urlString = "http://localhost:4000" case .mockServer: urlString = "http://localhost/dummy_url" + case .mockPort8080: + urlString = "http://localhost:8080/graphql" } return URL(string: urlString)! diff --git a/Tests/ApolloServerIntegrationTests/LegacyInterceptorProviderIntegrationTests.swift b/Tests/ApolloServerIntegrationTests/LegacyInterceptorProviderIntegrationTests.swift index 00e73d33a2..ce4124613d 100644 --- a/Tests/ApolloServerIntegrationTests/LegacyInterceptorProviderIntegrationTests.swift +++ b/Tests/ApolloServerIntegrationTests/LegacyInterceptorProviderIntegrationTests.swift @@ -1,5 +1,6 @@ import Apollo import XCTest +import StarWarsAPI /// Tests that the `LegacyInterceptorProvider` configures an `ApolloClient` that successfully /// communicates with an external Apollo Server. diff --git a/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift index 51a36d9bc9..2096474735 100644 --- a/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsServerCachingRoundtripTests.swift @@ -1,7 +1,6 @@ import XCTest @testable import Apollo import ApolloTestSupport -import ApolloSQLiteTestSupport import StarWarsAPI class SQLiteStarWarsServerCachingRoundtripTests: StarWarsServerCachingRoundtripTests { @@ -28,7 +27,7 @@ class StarWarsServerCachingRoundtripTests: XCTestCase, CacheDependentTesting { store = ApolloStore(cache: cache) let provider = LegacyInterceptorProvider(store: store) let network = RequestChainNetworkTransport(interceptorProvider: provider, - endpointURL: TestURL.starWarsServer.url) + endpointURL: TestServerURL.starWarsServer.url) client = ApolloClient(networkTransport: network, store: store) } diff --git a/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift index 7f054d30fb..10e36789b6 100644 --- a/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsServerTests.swift @@ -1,7 +1,6 @@ import XCTest @testable import Apollo import ApolloTestSupport -import ApolloSQLiteTestSupport import StarWarsAPI class StarWarsServerAPQsGetMethodTests: StarWarsServerTests { diff --git a/Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift index e9e36183d1..c7656db1c3 100644 --- a/Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsSubscriptionTests.swift @@ -21,7 +21,7 @@ class StarWarsSubscriptionTests: XCTestCase { self.connectionStartedExpectation = self.expectation(description: "Web socket connected") WebSocketTransport.provider = ApolloWebSocket.self - webSocketTransport = WebSocketTransport(request: URLRequest(url: TestURL.starWarsWebSocket.url)) + webSocketTransport = WebSocketTransport(request: URLRequest(url: TestServerURL.starWarsWebSocket.url)) webSocketTransport.delegate = self client = ApolloClient(networkTransport: webSocketTransport, store: ApolloStore()) @@ -392,7 +392,7 @@ class StarWarsSubscriptionTests: XCTestCase { func testConcurrentConnectAndCloseConnection() { WebSocketTransport.provider = MockWebSocket.self - let webSocketTransport = WebSocketTransport(request: URLRequest(url: TestURL.starWarsWebSocket.url)) + let webSocketTransport = WebSocketTransport(request: URLRequest(url: TestServerURL.starWarsWebSocket.url)) let expectation = self.expectation(description: "Connection closed") expectation.expectedFulfillmentCount = 2 @@ -419,7 +419,7 @@ class StarWarsSubscriptionTests: XCTestCase { let store = ApolloStore() let interceptorProvider = LegacyInterceptorProvider(store: store) let alternateTransport = RequestChainNetworkTransport(interceptorProvider: interceptorProvider, - endpointURL: TestURL.starWarsServer.url) + endpointURL: TestServerURL.starWarsServer.url) let alternateClient = ApolloClient(networkTransport: alternateTransport, store: store) func sendReview() { diff --git a/Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift b/Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift index 2f9e84e1e8..a17959d1f5 100755 --- a/Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift +++ b/Tests/ApolloServerIntegrationTests/StarWarsWebSocketTests.swift @@ -21,7 +21,7 @@ class StarWarsWebSocketTests: XCTestCase, CacheDependentTesting { cache = try makeNormalizedCache() let store = ApolloStore(cache: cache) - let networkTransport = WebSocketTransport(request: URLRequest(url: TestURL.starWarsWebSocket.url)) + let networkTransport = WebSocketTransport(request: URLRequest(url: TestServerURL.starWarsWebSocket.url)) client = ApolloClient(networkTransport: networkTransport, store: store) } diff --git a/Tests/ApolloTests/HTTPBinAPI.swift b/Tests/ApolloServerIntegrationTests/TestHelpers/HTTPBinAPI.swift similarity index 100% rename from Tests/ApolloTests/HTTPBinAPI.swift rename to Tests/ApolloServerIntegrationTests/TestHelpers/HTTPBinAPI.swift diff --git a/Tests/ApolloServerIntegrationTests/TestHelpers/TestServerURLs.swift b/Tests/ApolloServerIntegrationTests/TestHelpers/TestServerURLs.swift index eef3a78c14..4b76b04eff 100644 --- a/Tests/ApolloServerIntegrationTests/TestHelpers/TestServerURLs.swift +++ b/Tests/ApolloServerIntegrationTests/TestHelpers/TestServerURLs.swift @@ -1,4 +1,6 @@ /// Local URLs for servers used in integration testing +import Foundation + public enum TestServerURL: String { case mockServer = "http://localhost/dummy_url" case starWarsServer = "http://localhost:8080/graphql" diff --git a/Tests/ApolloServerIntegrationTests/UploadTests.swift b/Tests/ApolloServerIntegrationTests/UploadTests.swift index baa09697a5..da2faabe3c 100644 --- a/Tests/ApolloServerIntegrationTests/UploadTests.swift +++ b/Tests/ApolloServerIntegrationTests/UploadTests.swift @@ -6,7 +6,7 @@ import StarWarsAPI class UploadTests: XCTestCase { - let uploadClientURL = TestURL.uploadServer.url + let uploadClientURL = TestServerURL.uploadServer.url lazy var client: ApolloClient = { let store = ApolloStore() diff --git a/Tests/ApolloTests/AutomaticPersistedQueriesTests.swift b/Tests/ApolloTests/AutomaticPersistedQueriesTests.swift index 041bff8caa..ad53c1fed3 100644 --- a/Tests/ApolloTests/AutomaticPersistedQueriesTests.swift +++ b/Tests/ApolloTests/AutomaticPersistedQueriesTests.swift @@ -5,7 +5,7 @@ import StarWarsAPI class AutomaticPersistedQueriesTests: XCTestCase { - private final let endpoint = TestURL.starWarsServer.url + private final let endpoint = TestURL.mockServer.url // MARK: - Helper Methods diff --git a/Tests/ApolloTests/GETTransformerTests.swift b/Tests/ApolloTests/GETTransformerTests.swift index c2f36fca30..b884bc2959 100644 --- a/Tests/ApolloTests/GETTransformerTests.swift +++ b/Tests/ApolloTests/GETTransformerTests.swift @@ -13,7 +13,7 @@ import StarWarsAPI class GETTransformerTests: XCTestCase { private let requestBodyCreator = ApolloRequestBodyCreator() - private lazy var url = TestURL.starWarsServer.url + private lazy var url = TestURL.mockPort8080.url func testEncodingQueryWithSingleParameter() { let operation = HeroNameQuery(episode: .empire) diff --git a/Tests/ApolloTests/GraphQLFileTests.swift b/Tests/ApolloTests/GraphQLFileTests.swift index 519d64b7af..eba49c8d5c 100644 --- a/Tests/ApolloTests/GraphQLFileTests.swift +++ b/Tests/ApolloTests/GraphQLFileTests.swift @@ -9,6 +9,7 @@ import XCTest @testable import Apollo +import ApolloTestSupport class GraphQLFileTests: XCTestCase { diff --git a/Tests/ApolloTests/MultipartFormDataTests.swift b/Tests/ApolloTests/MultipartFormDataTests.swift index b8dbc8c8f0..32ab2a2806 100644 --- a/Tests/ApolloTests/MultipartFormDataTests.swift +++ b/Tests/ApolloTests/MultipartFormDataTests.swift @@ -8,6 +8,7 @@ import XCTest import Apollo +import ApolloTestSupport class MultipartFormDataTests: XCTestCase { func testSingleFile() throws { diff --git a/Tests/ApolloTests/WebSocket/SplitNetworkTransportTests.swift b/Tests/ApolloTests/WebSocket/SplitNetworkTransportTests.swift index e94d852bb8..350c3f5b36 100644 --- a/Tests/ApolloTests/WebSocket/SplitNetworkTransportTests.swift +++ b/Tests/ApolloTests/WebSocket/SplitNetworkTransportTests.swift @@ -28,7 +28,7 @@ class SplitNetworkTransportTests: XCTestCase { }() private lazy var webSocketTransport: WebSocketTransport = { - let request = URLRequest(url: TestURL.starWarsWebSocket.url) + let request = URLRequest(url: TestURL.mockServer.url) return WebSocketTransport(request: request, clientName: self.webSocketName, clientVersion: self.webSocketVersion) From b0612c200204aa9e6e36db200e318fb5c16868e2 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 6 Apr 2021 12:55:13 -0700 Subject: [PATCH 10/30] Fixed test targets to use MacOS 10.15 --- Apollo.xcodeproj/project.pbxproj | 8 -------- .../Apollo-Target-CacheDependentTests.xcconfig | 3 --- .../Apollo/Apollo-Target-TestSupport.xcconfig | 3 +++ .../ApolloSQLite-Target-TestSupport.xcconfig | 7 ------- .../Apollo/ApolloSQLite-Target-Tests.xcconfig | 3 --- .../ApolloWebSocket-Target-Tests.xcconfig | 3 --- .../Shared/Workspace-Target-Test.xcconfig | 3 +++ Sources/ApolloTestSupport/MockURLSession.swift | 18 ++++++++++++++---- 8 files changed, 20 insertions(+), 28 deletions(-) delete mode 100644 Configuration/Apollo/Apollo-Target-CacheDependentTests.xcconfig delete mode 100644 Configuration/Apollo/ApolloSQLite-Target-TestSupport.xcconfig delete mode 100644 Configuration/Apollo/ApolloSQLite-Target-Tests.xcconfig delete mode 100644 Configuration/Apollo/ApolloWebSocket-Target-Tests.xcconfig diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index 77c60fa31a..c05d4245af 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -520,7 +520,6 @@ 90690D142243363D00FC2E54 /* Apollo-Target-TestHost-iOS.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-TestHost-iOS.xcconfig"; sourceTree = ""; }; 90690D2122433C1900FC2E54 /* Apollo-Target-StarWarsAPI.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-StarWarsAPI.xcconfig"; sourceTree = ""; }; 90690D2222433C2800FC2E54 /* Apollo-Target-GitHubAPI.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-GitHubAPI.xcconfig"; sourceTree = ""; }; - 90690D2322433C5900FC2E54 /* Apollo-Target-CacheDependentTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-CacheDependentTests.xcconfig"; sourceTree = ""; }; 90690D2422433C8000FC2E54 /* Apollo-Target-PerformanceTests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-PerformanceTests.xcconfig"; sourceTree = ""; }; 90690D2522433CAF00FC2E54 /* Apollo-Target-TestSupport.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Apollo-Target-TestSupport.xcconfig"; sourceTree = ""; }; 9B0E4717240AF6D70093BDA7 /* ASTVariableType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ASTVariableType.swift; sourceTree = ""; }; @@ -660,7 +659,6 @@ 9B7BDA9823FDE94C00ACD198 /* ApolloWebSocket.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ApolloWebSocket.swift; sourceTree = ""; }; 9B7BDA9923FDE94C00ACD198 /* WebSocketTransport.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebSocketTransport.swift; sourceTree = ""; }; 9B7BDA9A23FDE94C00ACD198 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 9B7BDAA223FDE98B00ACD198 /* ApolloWebSocket-Target-Tests.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Target-Tests.xcconfig"; sourceTree = ""; }; 9B7BDAA323FDE98C00ACD198 /* ApolloWebSocket-Project-Release.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Project-Release.xcconfig"; sourceTree = ""; }; 9B7BDAA423FDE98C00ACD198 /* ApolloWebSocket-Target-Framework.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Target-Framework.xcconfig"; sourceTree = ""; }; 9B7BDAA523FDE98C00ACD198 /* ApolloWebSocket-Project-Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = "ApolloWebSocket-Project-Debug.xcconfig"; sourceTree = ""; }; @@ -671,8 +669,6 @@ 9B7BDAD423FDEC9B00ACD198 /* CachePersistenceTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CachePersistenceTests.swift; sourceTree = ""; }; 9B7BDAD823FDECB300ACD198 /* ApolloSQLite-Target-Framework.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Target-Framework.xcconfig"; sourceTree = ""; }; 9B7BDAD923FDECB400ACD198 /* ApolloSQLite-Project-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Project-Debug.xcconfig"; sourceTree = ""; }; - 9B7BDADA23FDECB400ACD198 /* ApolloSQLite-Target-Tests.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Target-Tests.xcconfig"; sourceTree = ""; }; - 9B7BDADB23FDECB400ACD198 /* ApolloSQLite-Target-TestSupport.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Target-TestSupport.xcconfig"; sourceTree = ""; }; 9B7BDADC23FDECB400ACD198 /* ApolloSQLite-Project-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "ApolloSQLite-Project-Release.xcconfig"; sourceTree = ""; }; 9B7BDAEC23FDED9700ACD198 /* SQLiteTestCacheProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SQLiteTestCacheProvider.swift; sourceTree = ""; }; 9B8110A723A1995D00688AC4 /* .keep */ = {isa = PBXFileReference; lastKnownFileType = text; path = .keep; sourceTree = ""; }; @@ -1016,7 +1012,6 @@ 9B7B6F55233C27A000F32205 /* Apollo-Target-ApolloCodegenLib.xcconfig */, 9B68354A2463498D00337AE6 /* Apollo-Target-ApolloCore.xcconfig */, DEA34AF6260E821F00F95F86 /* Apollo-Target-AnimalKingdomAPI.xcconfig */, - 90690D2322433C5900FC2E54 /* Apollo-Target-CacheDependentTests.xcconfig */, 9B4AA8AD239EFDC9003E1300 /* Apollo-Target-CodegenTests.xcconfig */, 90690D06224333DA00FC2E54 /* Apollo-Target-Framework.xcconfig */, 90690D2222433C2800FC2E54 /* Apollo-Target-GitHubAPI.xcconfig */, @@ -1030,13 +1025,10 @@ 9B7BDAD923FDECB400ACD198 /* ApolloSQLite-Project-Debug.xcconfig */, 9B7BDADC23FDECB400ACD198 /* ApolloSQLite-Project-Release.xcconfig */, 9B7BDAD823FDECB300ACD198 /* ApolloSQLite-Target-Framework.xcconfig */, - 9B7BDADA23FDECB400ACD198 /* ApolloSQLite-Target-Tests.xcconfig */, 9B9BBB1624DB74720021C30F /* Apollo-Target-UploadAPI.xcconfig */, - 9B7BDADB23FDECB400ACD198 /* ApolloSQLite-Target-TestSupport.xcconfig */, 9B7BDAA523FDE98C00ACD198 /* ApolloWebSocket-Project-Debug.xcconfig */, 9B7BDAA323FDE98C00ACD198 /* ApolloWebSocket-Project-Release.xcconfig */, 9B7BDAA423FDE98C00ACD198 /* ApolloWebSocket-Target-Framework.xcconfig */, - 9B7BDAA223FDE98B00ACD198 /* ApolloWebSocket-Target-Tests.xcconfig */, ); name = Configuration; path = Configuration/Apollo; diff --git a/Configuration/Apollo/Apollo-Target-CacheDependentTests.xcconfig b/Configuration/Apollo/Apollo-Target-CacheDependentTests.xcconfig deleted file mode 100644 index 87d472f37b..0000000000 --- a/Configuration/Apollo/Apollo-Target-CacheDependentTests.xcconfig +++ /dev/null @@ -1,3 +0,0 @@ -#include "../Shared/Workspace-Universal-Test.xcconfig" - -INFOPLIST_FILE = Tests/ApolloCacheDependentTests/Info.plist diff --git a/Configuration/Apollo/Apollo-Target-TestSupport.xcconfig b/Configuration/Apollo/Apollo-Target-TestSupport.xcconfig index 3d6c711658..76065cc6e7 100644 --- a/Configuration/Apollo/Apollo-Target-TestSupport.xcconfig +++ b/Configuration/Apollo/Apollo-Target-TestSupport.xcconfig @@ -6,3 +6,6 @@ APPLICATION_EXTENSION_API_ONLY = NO LIBRARY_SEARCH_PATHS[sdk=iphonesimulator*] = $(inherited) $(TOOLCHAIN_DIR)/usr/lib/swift-$(SWIFT_VERSION)/$(PLATFORM_NAME) FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_FRAMEWORKS_DIR) $(PLATFORM_DIR)/Developer/Library/Frameworks OTHER_LDFLAGS = -weak_framework XCTest -weak-lswiftXCTest + +/// Test Target Deployment Target +MACOSX_DEPLOYMENT_TARGET = 10.15 diff --git a/Configuration/Apollo/ApolloSQLite-Target-TestSupport.xcconfig b/Configuration/Apollo/ApolloSQLite-Target-TestSupport.xcconfig deleted file mode 100644 index 0f1145317d..0000000000 --- a/Configuration/Apollo/ApolloSQLite-Target-TestSupport.xcconfig +++ /dev/null @@ -1,7 +0,0 @@ -#include "../Shared/Workspace-Universal-Framework.xcconfig" - -INFOPLIST_FILE = Sources/ApolloSQLiteTestSupport/Info.plist - -APPLICATION_EXTENSION_API_ONLY = NO -FRAMEWORK_SEARCH_PATHS = $(DEVELOPER_FRAMEWORKS_DIR) $(PLATFORM_DIR)/Developer/Library/Frameworks -OTHER_LDFLAGS = -weak_framework XCTest -weak-lswiftXCTest diff --git a/Configuration/Apollo/ApolloSQLite-Target-Tests.xcconfig b/Configuration/Apollo/ApolloSQLite-Target-Tests.xcconfig deleted file mode 100644 index cc977a6368..0000000000 --- a/Configuration/Apollo/ApolloSQLite-Target-Tests.xcconfig +++ /dev/null @@ -1,3 +0,0 @@ -#include "../Shared/Workspace-Universal-Test.xcconfig" - -INFOPLIST_FILE = Tests/ApolloSQLiteTests/Info.plist diff --git a/Configuration/Apollo/ApolloWebSocket-Target-Tests.xcconfig b/Configuration/Apollo/ApolloWebSocket-Target-Tests.xcconfig deleted file mode 100644 index a91bc531e2..0000000000 --- a/Configuration/Apollo/ApolloWebSocket-Target-Tests.xcconfig +++ /dev/null @@ -1,3 +0,0 @@ -#include "../Shared/Workspace-Universal-Test.xcconfig" - -INFOPLIST_FILE = Tests/ApolloWebSocketTests/Info.plist diff --git a/Configuration/Shared/Workspace-Target-Test.xcconfig b/Configuration/Shared/Workspace-Target-Test.xcconfig index dc0a41fda4..c5c18604db 100644 --- a/Configuration/Shared/Workspace-Target-Test.xcconfig +++ b/Configuration/Shared/Workspace-Target-Test.xcconfig @@ -6,3 +6,6 @@ ENABLE_BITCODE = NO // Disable some known troublesome warnings for the test target, as -Weverything without these exceptions causes errors when importing XCTest WARNING_CFLAGS = $(inherited) -Wno-documentation-unknown-command -Wno-incomplete-module -Wno-disabled-macro-expansion -Wno-shadow + +/// Test Target Deployment Target +MACOSX_DEPLOYMENT_TARGET = 10.15 diff --git a/Sources/ApolloTestSupport/MockURLSession.swift b/Sources/ApolloTestSupport/MockURLSession.swift index 290e70b5e9..449b1a0209 100644 --- a/Sources/ApolloTestSupport/MockURLSession.swift +++ b/Sources/ApolloTestSupport/MockURLSession.swift @@ -49,14 +49,24 @@ public final class MockURLSessionClient: URLSessionClient { completion(.success((data, response))) } } - - - let mockTask = URLSessionDataTaskMock() + + let mockTaskType: URLSessionDataTaskMockProtocol.Type = URLSessionDataTaskMock.self + let mockTask = mockTaskType.init() as! URLSessionDataTaskMock return mockTask } } -private final class URLSessionDataTaskMock: URLSessionDataTask { +protocol URLSessionDataTaskMockProtocol { + init() +} + +private final class URLSessionDataTaskMock: URLSessionDataTask, URLSessionDataTaskMockProtocol{ + + @available(macOS, deprecated: 10.15) + override init() { + super.init() + } + override func resume() { // No-op } From d64fcdc031fd824ac3b4f18f020868cef0647f9b Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 6 Apr 2021 14:55:50 -0700 Subject: [PATCH 11/30] Fix SwiftScripts builds --- .gitignore | 1 + Apollo.xcodeproj/project.pbxproj | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 95633047d4..179dc58058 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,4 @@ scripts/apollo.tar.gz SwiftScripts/ApolloCLI Tests/ApolloCodegenTests/scripts Tests/ApolloCodegenTests/scripts directory +SwiftScripts/.build-** diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index c05d4245af..2ba9e929bc 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -1051,9 +1051,9 @@ 9B2061162591B3550020D1E0 /* Resources */ = { isa = PBXGroup; children = ( - 9B2061172591B3550020D1E0 /* c.txt */, - 9B2061182591B3550020D1E0 /* b.txt */, 9B2061192591B3550020D1E0 /* a.txt */, + 9B2061182591B3550020D1E0 /* b.txt */, + 9B2061172591B3550020D1E0 /* c.txt */, ); path = Resources; sourceTree = ""; @@ -2505,7 +2505,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd \"${SRCROOT}/SwiftScripts\"\nxcrun -sdk macosx swift run Codegen -t \"GitHub\"\n"; + shellScript = "cd \"${SRCROOT}/SwiftScripts\"\nxcrun -sdk macosx swift run --build-path \"./.build-GitHub\" Codegen -t \"GitHub\"\n"; }; 9FCE2D061E6C251100E34457 /* Generate Apollo Client API */ = { isa = PBXShellScriptBuildPhase; @@ -2519,7 +2519,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "cd \"${SRCROOT}/SwiftScripts\"\nxcrun -sdk macosx swift run Codegen -t \"StarWars\"\n"; + shellScript = "cd \"${SRCROOT}/SwiftScripts\"\nxcrun -sdk macosx swift run --build-path \"./.build-StarWars\" Codegen -t \"StarWars\"\n"; showEnvVarsInLog = 0; }; /* End PBXShellScriptBuildPhase section */ From 3f4932eb2d643d30e39156f6e316ae171f95c642 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 6 Apr 2021 15:36:26 -0700 Subject: [PATCH 12/30] Typo in CircleCI config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 328737c3db..2c9c7e9836 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ commands: command: xcodebuild clean build build-for-testing -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" | xcpretty name: Clean and build for testing - run: - command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" --testplan "${CIRCLE_XCODE_TEST_PLAN}" | xcpretty + command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" --testPlan "${CIRCLE_XCODE_TEST_PLAN}" | xcpretty name: Run tests - save-xcodebuild-artifacts - save_cache: From d4c1fbeeb142b5097c212dd94327551677b56bd9 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 13 Apr 2021 10:42:15 -0700 Subject: [PATCH 13/30] Minor fixes --- Apollo.xcodeproj/project.pbxproj | 18 +++++-- .../xcschemes/Apollo Playground.xcscheme | 50 +------------------ .../xcshareddata/xcschemes/Apollo.xcscheme | 20 ++------ .../xcschemes/ApolloCodegenLib.xcscheme | 14 +----- .../xcschemes/ApolloCore.xcscheme | 6 +-- .../xcschemes/ApolloPerformanceTests.xcscheme | 2 +- .../xcschemes/ApolloSQLite.xcscheme | 50 +------------------ .../ApolloServerIntegrationTests.xcscheme | 2 +- .../xcschemes/ApolloWebSocket.xcscheme | 14 +----- .../ApolloTestSupport/MockURLSession.swift | 2 + .../Apollo-CITestPlan.xctestplan | 0 .../Apollo-CodegenTestPlan.xctestplan | 0 .../Apollo-IntegrationTestPlan.xctestplan | 0 .../Apollo-PerformanceTestPlan.xctestplan | 0 .../Apollo-UnitTestPlan.xctestplan | 0 15 files changed, 28 insertions(+), 150 deletions(-) rename Tests/{ => TestPlans}/Apollo-CITestPlan.xctestplan (100%) rename Tests/{ => TestPlans}/Apollo-CodegenTestPlan.xctestplan (100%) rename Tests/{ => TestPlans}/Apollo-IntegrationTestPlan.xctestplan (100%) rename Tests/{ => TestPlans}/Apollo-PerformanceTestPlan.xctestplan (100%) rename Tests/{ => TestPlans}/Apollo-UnitTestPlan.xctestplan (100%) diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index 2ba9e929bc..998b858589 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -1720,11 +1720,7 @@ 9FCE2CF41E6C20E000E34457 /* Tests */ = { isa = PBXGroup; children = ( - DED45DC7261682260086EF63 /* Apollo-UnitTestPlan.xctestplan */, - DED45C3B26165DD70086EF63 /* Apollo-IntegrationTestPlan.xctestplan */, - DED45FB1261CDE7D0086EF63 /* Apollo-PerformanceTestPlan.xctestplan */, - DED45FB2261CDE980086EF63 /* Apollo-CITestPlan.xctestplan */, - DED45FB3261CDEC60086EF63 /* Apollo-CodegenTestPlan.xctestplan */, + DE4B66B726260EBE00AE90A9 /* TestPlans */, 9FC750521D2A532D00458D91 /* ApolloTests */, 9F54C8B5255D760B0065AFD6 /* ApolloPerformanceTests */, 9BAEEC0A234BB95B00808306 /* ApolloCodegenTests */, @@ -1806,6 +1802,18 @@ path = CodegenCore; sourceTree = ""; }; + DE4B66B726260EBE00AE90A9 /* TestPlans */ = { + isa = PBXGroup; + children = ( + DED45DC7261682260086EF63 /* Apollo-UnitTestPlan.xctestplan */, + DED45C3B26165DD70086EF63 /* Apollo-IntegrationTestPlan.xctestplan */, + DED45FB1261CDE7D0086EF63 /* Apollo-PerformanceTestPlan.xctestplan */, + DED45FB2261CDE980086EF63 /* Apollo-CITestPlan.xctestplan */, + DED45FB3261CDEC60086EF63 /* Apollo-CodegenTestPlan.xctestplan */, + ); + path = TestPlans; + sourceTree = ""; + }; DE6B15AD26152BE10068D642 /* ApolloServerIntegrationTests */ = { isa = PBXGroup; children = ( diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo Playground.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo Playground.xcscheme index b02f13b671..1d9a103e5c 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo Playground.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/Apollo Playground.xcscheme @@ -84,58 +84,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - + reference = "container:Tests/TestPlans/Apollo-IntegrationTestPlan.xctestplan"> + reference = "container:Tests/TestPlans/Apollo-PerformanceTestPlan.xctestplan"> + reference = "container:Tests/TestPlans/Apollo-CITestPlan.xctestplan"> - - - - - - - - - - - - + reference = "container:Tests/TestPlans/Apollo-IntegrationTestPlan.xctestplan"> + reference = "container:Tests/TestPlans/Apollo-PerformanceTestPlan.xctestplan"> diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloPerformanceTests.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloPerformanceTests.xcscheme index 0b53c09c80..c72a6f6415 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloPerformanceTests.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloPerformanceTests.xcscheme @@ -14,7 +14,7 @@ disableMainThreadChecker = "YES"> diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme index 661ccf1573..fc7b7c0765 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloSQLite.xcscheme @@ -48,58 +48,10 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme index f32e7a8fdb..ef6225b929 100644 --- a/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme +++ b/Apollo.xcodeproj/xcshareddata/xcschemes/ApolloWebSocket.xcscheme @@ -48,22 +48,10 @@ - - - - - - Date: Tue, 13 Apr 2021 11:06:40 -0700 Subject: [PATCH 14/30] Fix circle CI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2c9c7e9836..0bdb8f1bde 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -63,7 +63,7 @@ commands: command: xcodebuild clean build build-for-testing -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" | xcpretty name: Clean and build for testing - run: - command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" --testPlan "${CIRCLE_XCODE_TEST_PLAN}" | xcpretty + command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" -testPlan "${CIRCLE_XCODE_TEST_PLAN}" | xcpretty name: Run tests - save-xcodebuild-artifacts - save_cache: From cb2f44cdc974b5811421af75be4fcc2e6a934964 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 13 Apr 2021 11:54:04 -0700 Subject: [PATCH 15/30] Bump CircleCI to use Xcode 12.4 (from 12.1) --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0bdb8f1bde..8adc121337 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 parameters: xcode_version: type: string - default: "12.1.0" + default: "12.4.0" ios_current_version: type: string default: "14.1" From 9205adad96f5d5c1a0212bd6e3268325a48ef1b6 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 13 Apr 2021 12:04:08 -0700 Subject: [PATCH 16/30] Fix simulator versions for CircleCI --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8adc121337..211fd8caac 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,10 +12,10 @@ parameters: default: "13.5" ios_sdk: type: string - default: "iphonesimulator14.1" + default: "iphonesimulator14.4" macos_version: # The user-facing version string for macOS builds type: string - default: "10.15" + default: "10.15.5" macos_sdk: # The full SDK string to use for macOS builds type: string default: "macosx10.15" @@ -24,7 +24,7 @@ parameters: default: "14.0" tvos_sdk: type: string - default: "appletvsimulator14.0" + default: "appletvsimulator14.3" commands: common_test_steps: From 6026db899c446358a2cf00a51f96db45c4061d15 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 13 Apr 2021 12:06:17 -0700 Subject: [PATCH 17/30] Fix macOS SDK version for CircleCI --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 211fd8caac..591da6781c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,10 +15,10 @@ parameters: default: "iphonesimulator14.4" macos_version: # The user-facing version string for macOS builds type: string - default: "10.15.5" + default: "10.15" macos_sdk: # The full SDK string to use for macOS builds type: string - default: "macosx10.15" + default: "macosx10.15.5" tvos_version: # The user-facing version string of tvOS builds type: string default: "14.0" From 820c636b51540ada3953169395a9313d4c9712a2 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 13 Apr 2021 12:17:11 -0700 Subject: [PATCH 18/30] Attempt to fix macos sdk on circleCI --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 591da6781c..ee0a663a4c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ parameters: default: "10.15" macos_sdk: # The full SDK string to use for macOS builds type: string - default: "macosx10.15.5" + default: "macosx" tvos_version: # The user-facing version string of tvOS builds type: string default: "14.0" From 4a8bb500433e928918c16a356f34470b776bbdd0 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 13 Apr 2021 12:51:37 -0700 Subject: [PATCH 19/30] Remove xcpretty for debugging CircleCI --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ee0a663a4c..7c001bda80 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,7 +18,7 @@ parameters: default: "10.15" macos_sdk: # The full SDK string to use for macOS builds type: string - default: "macosx" + default: "macosx11.1" tvos_version: # The user-facing version string of tvOS builds type: string default: "14.0" @@ -60,10 +60,10 @@ commands: command: sudo chmod -R +rwx SimpleUploadServer name: Adjust permissions for simple upload server folder - run: - command: xcodebuild clean build build-for-testing -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" | xcpretty + command: xcodebuild clean build build-for-testing -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" name: Clean and build for testing - run: - command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" -testPlan "${CIRCLE_XCODE_TEST_PLAN}" | xcpretty + command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" -testPlan "${CIRCLE_XCODE_TEST_PLAN}" name: Run tests - save-xcodebuild-artifacts - save_cache: From 5998d8ed6f0bbc5a7fb3e7b12f42a805f507aa42 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 13 Apr 2021 12:59:04 -0700 Subject: [PATCH 20/30] More fixes for sdk versions --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7c001bda80..3192abe4a8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,10 +6,10 @@ parameters: default: "12.4.0" ios_current_version: type: string - default: "14.1" + default: "14.4" ios_previous_version: type: string - default: "13.5" + default: "13.7" ios_sdk: type: string default: "iphonesimulator14.4" From 7b642f31729c6df1659f8e3e5f861357e98e1247 Mon Sep 17 00:00:00 2001 From: Ellen Shapiro Date: Tue, 13 Apr 2021 16:37:47 -0500 Subject: [PATCH 21/30] update tvOS version on circle --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3192abe4a8..71bfda6ebd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,7 +21,7 @@ parameters: default: "macosx11.1" tvos_version: # The user-facing version string of tvOS builds type: string - default: "14.0" + default: "14.3" tvos_sdk: type: string default: "appletvsimulator14.3" From 9fe338c9cfdbe77af4a7419ad1d54b05e359eb47 Mon Sep 17 00:00:00 2001 From: Ellen Shapiro Date: Tue, 13 Apr 2021 17:00:13 -0500 Subject: [PATCH 22/30] Add log to try to figure out what on earth is going on with the SHASUM --- Sources/ApolloCodegenLib/FileManager+Apollo.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/ApolloCodegenLib/FileManager+Apollo.swift b/Sources/ApolloCodegenLib/FileManager+Apollo.swift index 4286996094..4e1385e872 100644 --- a/Sources/ApolloCodegenLib/FileManager+Apollo.swift +++ b/Sources/ApolloCodegenLib/FileManager+Apollo.swift @@ -89,6 +89,8 @@ extension ApolloExtension where Base == FileManager { /// /// - Parameter fileURL: The file to calculate the SHASUM for. public func shasum(at fileURL: URL) throws -> String { + CodegenLogger.log("Checking SHASUM for file at URL: \(fileURL)") + let file = try FileHandle(forReadingFrom: fileURL) defer { file.closeFile() From cbe9fab60c01a56b4f256fee13a1423d35096531 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Tue, 13 Apr 2021 15:18:59 -0700 Subject: [PATCH 23/30] Fix linker issues with ApolloCodegenTests --- Apollo.xcodeproj/project.pbxproj | 41 +++++++------------ .../ApolloSchemaTests.swift | 8 ++-- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/Apollo.xcodeproj/project.pbxproj b/Apollo.xcodeproj/project.pbxproj index 998b858589..9c941e9e92 100644 --- a/Apollo.xcodeproj/project.pbxproj +++ b/Apollo.xcodeproj/project.pbxproj @@ -250,6 +250,7 @@ DE3C7B1B260A6FCA00D2F4FF /* ScalarTypes.swift in Sources */ = {isa = PBXBuildFile; fileRef = DE3C7B15260A6FCA00D2F4FF /* ScalarTypes.swift */; }; DE3C7B4A260A73D800D2F4FF /* AnimalKingdomAPI.h in Headers */ = {isa = PBXBuildFile; fileRef = DE3C79A9260A6ACD00D2F4FF /* AnimalKingdomAPI.h */; settings = {ATTRIBUTES = (Public, ); }; }; DE3C7B4B260A73F900D2F4FF /* schema.graphqls in Resources */ = {isa = PBXBuildFile; fileRef = DE3C7AB9260A6D3E00D2F4FF /* schema.graphqls */; }; + DE4B66EA26264F6C00AE90A9 /* ApolloTestSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9F8A95781EC0FC1200304A2D /* ApolloTestSupport.framework */; }; DE674D9D261CEEE4000E8FC8 /* c.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061172591B3550020D1E0 /* c.txt */; }; DE674D9E261CEEE4000E8FC8 /* b.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061182591B3550020D1E0 /* b.txt */; }; DE674D9F261CEEE4000E8FC8 /* a.txt in Resources */ = {isa = PBXBuildFile; fileRef = 9B2061192591B3550020D1E0 /* a.txt */; }; @@ -313,13 +314,6 @@ remoteGlobalIDString = 9B68353D2463481A00337AE6; remoteInfo = ApolloCore; }; - 9B68354C24634A2000337AE6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9B68353D2463481A00337AE6; - remoteInfo = ApolloCore; - }; 9B7BDAF723FDEE8400ACD198 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; @@ -348,13 +342,6 @@ remoteGlobalIDString = 9B7B6F46233C26D100F32205; remoteInfo = ApolloCodegenLib; }; - 9BEEDC2C24EB6419001D1294 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 9F8A95771EC0FC1200304A2D; - remoteInfo = ApolloTestSupport; - }; 9F54C8BA255D760B0065AFD6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; @@ -432,6 +419,13 @@ remoteGlobalIDString = 9B68353D2463481A00337AE6; remoteInfo = ApolloCore; }; + DE4B66E826264F6900AE90A9 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 9F8A95771EC0FC1200304A2D; + remoteInfo = ApolloTestSupport; + }; DE6B15B226152BE10068D642 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 9FC7503B1D2A532C00458D91 /* Project object */; @@ -926,6 +920,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + DE4B66EA26264F6C00AE90A9 /* ApolloTestSupport.framework in Frameworks */, 9FDE0752258F3BC200DC0CA5 /* StarWarsAPI.framework in Frameworks */, 9BAEEC01234BB8FD00808306 /* ApolloCodegenLib.framework in Frameworks */, ); @@ -2101,9 +2096,8 @@ buildRules = ( ); dependencies = ( + DE4B66E926264F6900AE90A9 /* PBXTargetDependency */, 9FDE0742258F3B6100DC0CA5 /* PBXTargetDependency */, - 9BEEDC2D24EB6419001D1294 /* PBXTargetDependency */, - 9B68354D24634A2000337AE6 /* PBXTargetDependency */, 9BAEEC03234BB8FD00808306 /* PBXTargetDependency */, ); name = ApolloCodegenTests; @@ -2888,11 +2882,6 @@ target = 9B68353D2463481A00337AE6 /* ApolloCore */; targetProxy = 9B683548246348CB00337AE6 /* PBXContainerItemProxy */; }; - 9B68354D24634A2000337AE6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9B68353D2463481A00337AE6 /* ApolloCore */; - targetProxy = 9B68354C24634A2000337AE6 /* PBXContainerItemProxy */; - }; 9B7BDAF823FDEE8400ACD198 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9FC750431D2A532C00458D91 /* Apollo */; @@ -2921,11 +2910,6 @@ target = 9B7B6F46233C26D100F32205 /* ApolloCodegenLib */; targetProxy = 9BAEEC02234BB8FD00808306 /* PBXContainerItemProxy */; }; - 9BEEDC2D24EB6419001D1294 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 9F8A95771EC0FC1200304A2D /* ApolloTestSupport */; - targetProxy = 9BEEDC2C24EB6419001D1294 /* PBXContainerItemProxy */; - }; 9F54C8BB255D760B0065AFD6 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9FC750431D2A532C00458D91 /* Apollo */; @@ -2981,6 +2965,11 @@ target = 9B68353D2463481A00337AE6 /* ApolloCore */; targetProxy = DE3C7A96260A6C1000D2F4FF /* PBXContainerItemProxy */; }; + DE4B66E926264F6900AE90A9 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 9F8A95771EC0FC1200304A2D /* ApolloTestSupport */; + targetProxy = DE4B66E826264F6900AE90A9 /* PBXContainerItemProxy */; + }; DE6B15B326152BE10068D642 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 9FC750431D2A532C00458D91 /* Apollo */; diff --git a/Tests/ApolloCodegenTests/ApolloSchemaTests.swift b/Tests/ApolloCodegenTests/ApolloSchemaTests.swift index 433104762b..b51992950d 100644 --- a/Tests/ApolloCodegenTests/ApolloSchemaTests.swift +++ b/Tests/ApolloCodegenTests/ApolloSchemaTests.swift @@ -15,12 +15,12 @@ class ApolloSchemaTests: XCTestCase { func testCreatingIntrospectionOptionsWithDefaultParameters() throws { let sourceRoot = CodegenTestHelper.sourceRootURL() - let options = ApolloSchemaOptions(downloadMethod: .introspection(endpointURL: TestURL.starWarsServer.url), + let options = ApolloSchemaOptions(downloadMethod: .introspection(endpointURL: TestURL.mockPort8080.url), outputFolderURL: sourceRoot) let expectedOutputURL = sourceRoot.appendingPathComponent("schema.json") - XCTAssertEqual(options.downloadMethod, .introspection(endpointURL: TestURL.starWarsServer.url)) + XCTAssertEqual(options.downloadMethod, .introspection(endpointURL: TestURL.mockPort8080.url)) XCTAssertEqual(options.outputURL, expectedOutputURL) XCTAssertTrue(options.headers.isEmpty) @@ -92,7 +92,7 @@ class ApolloSchemaTests: XCTestCase { func testDownloadingSchemaAsJSON() throws { let testOutputFolderURL = CodegenTestHelper.outputFolderURL() - let options = ApolloSchemaOptions(downloadMethod: .introspection(endpointURL: TestURL.starWarsServer.url), + let options = ApolloSchemaOptions(downloadMethod: .introspection(endpointURL: TestURL.mockPort8080.url), outputFolderURL: testOutputFolderURL) // Delete anything existing at the output URL @@ -126,7 +126,7 @@ class ApolloSchemaTests: XCTestCase { let testOutputFolderURL = CodegenTestHelper.outputFolderURL() let options = ApolloSchemaOptions(schemaFileType: .schemaDefinitionLanguage, - downloadMethod: .introspection(endpointURL: TestURL.starWarsServer.url), + downloadMethod: .introspection(endpointURL: TestURL.mockPort8080.url), outputFolderURL: testOutputFolderURL) // Delete anything existing at the output URL From d690b2181fa083303b3c6bae314340d04cfe2cb3 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 14 Apr 2021 11:51:13 -0700 Subject: [PATCH 24/30] Use an NSDIstributedLock to lock the CLI folder while downloading, extracting, and checking SHASUM --- Sources/ApolloCodegenLib/ApolloCLI.swift | 35 +++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/Sources/ApolloCodegenLib/ApolloCLI.swift b/Sources/ApolloCodegenLib/ApolloCLI.swift index 1edab2e1d8..04dc460da9 100644 --- a/Sources/ApolloCodegenLib/ApolloCLI.swift +++ b/Sources/ApolloCodegenLib/ApolloCLI.swift @@ -5,6 +5,10 @@ import Foundation /// Wrapper for calling the bundled node-based Apollo CLI. public struct ApolloCLI { + + enum ApolloCLIError: Error { + case lockInitializationFailed(URL) + } /// Creates an instance of `ApolloCLI`, downloading and extracting if needed /// @@ -12,6 +16,9 @@ public struct ApolloCLI { /// - cliFolderURL: The URL to the folder which contains the zip file with the CLI. /// - timeout: The maximum time to wait before indicating that the download timed out, in seconds. public static func createCLI(cliFolderURL: URL, timeout: Double) throws -> ApolloCLI { + let lock = try waitForCLIFolderLock(cliFolderURL: cliFolderURL, timeout: timeout) + defer { lock.unlock() } + try CLIDownloader.downloadIfNeeded(cliFolderURL: cliFolderURL, timeout: timeout) if !(try CLIExtractor.validateSHASUMOfDownloadedFile(in: cliFolderURL)) { @@ -22,7 +29,33 @@ public struct ApolloCLI { let binaryFolderURL = try CLIExtractor.extractCLIIfNeeded(from: cliFolderURL) return ApolloCLI(binaryFolderURL: binaryFolderURL) } - + + private static func waitForCLIFolderLock(cliFolderURL: URL, timeout: Double) throws -> NSDistributedLock { + guard let lock = NSDistributedLock(path: cliFolderURL.path) else { + throw ApolloCLIError.lockInitializationFailed(cliFolderURL) + } + + let maxPollCount = Int(timeout/2) + var pollCount = 0 + + repeat { + if lock.try() { + return lock + + } else { + pollCount += 1 + + if pollCount <= maxPollCount { + usleep(500_000) // sleep 0.5 seconds + } + } + } while pollCount <= maxPollCount + + lock.break() // After timeout, we force the lock. If another process failed and did not + // relinquish the lock, we should break the lock. + return lock + } + public let binaryFolderURL: URL /// Designated initializer From 90b1f0421b76bcea581b892732e8270a988620ad Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 14 Apr 2021 12:27:22 -0700 Subject: [PATCH 25/30] =?UTF-8?q?Use=20=E2=80=9C.lock=E2=80=9D=20on=20path?= =?UTF-8?q?=20for=20NSDistributedLock?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/ApolloCodegenLib/ApolloCLI.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ApolloCodegenLib/ApolloCLI.swift b/Sources/ApolloCodegenLib/ApolloCLI.swift index 04dc460da9..69c07d03eb 100644 --- a/Sources/ApolloCodegenLib/ApolloCLI.swift +++ b/Sources/ApolloCodegenLib/ApolloCLI.swift @@ -31,7 +31,7 @@ public struct ApolloCLI { } private static func waitForCLIFolderLock(cliFolderURL: URL, timeout: Double) throws -> NSDistributedLock { - guard let lock = NSDistributedLock(path: cliFolderURL.path) else { + guard let lock = NSDistributedLock(path: cliFolderURL.path + ".lock") else { throw ApolloCLIError.lockInitializationFailed(cliFolderURL) } From 7d757e88368af7b1f17bf0e55504e0eff731e17c Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 14 Apr 2021 13:03:54 -0700 Subject: [PATCH 26/30] Atomically write SHASUM to extracted zip --- Sources/ApolloCodegenLib/CLIExtractor.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/ApolloCodegenLib/CLIExtractor.swift b/Sources/ApolloCodegenLib/CLIExtractor.swift index 486aac529c..ea67214afc 100644 --- a/Sources/ApolloCodegenLib/CLIExtractor.swift +++ b/Sources/ApolloCodegenLib/CLIExtractor.swift @@ -74,7 +74,8 @@ struct CLIExtractor { guard contents == expected else { return contents.hasPrefix(expected) } - + + CodegenLogger.log("Extracted zip SHASHUM: \(contents)") return true } @@ -100,7 +101,7 @@ struct CLIExtractor { static func writeSHASUMToFile(apolloFolderURL: URL) throws { let shasumFileURL = ApolloFilePathHelper.shasumFileURL(fromApollo: apolloFolderURL) try CLIExtractor.expectedSHASUM.write(to: shasumFileURL, - atomically: false, + atomically: true, encoding: .utf8) } From b8e26040a2acb51b5e29e862c9bf1e7148a5a30e Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 14 Apr 2021 13:12:34 -0700 Subject: [PATCH 27/30] Try logging --- Sources/ApolloCodegenLib/CLIExtractor.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/ApolloCodegenLib/CLIExtractor.swift b/Sources/ApolloCodegenLib/CLIExtractor.swift index ea67214afc..d57007a1cb 100644 --- a/Sources/ApolloCodegenLib/CLIExtractor.swift +++ b/Sources/ApolloCodegenLib/CLIExtractor.swift @@ -70,12 +70,13 @@ struct CLIExtractor { } let contents = try String(contentsOf: shasumFileURL, encoding: .utf8) - + + CodegenLogger.log("Extracted zip SHASHUM: \(contents)") + guard contents == expected else { return contents.hasPrefix(expected) } - CodegenLogger.log("Extracted zip SHASHUM: \(contents)") return true } From 22a6e4c8952c8cfa04362992047959b02522dafa Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 14 Apr 2021 13:56:58 -0700 Subject: [PATCH 28/30] Attempt changing permissions for extracted CLI folder --- Sources/ApolloCodegenLib/CLIExtractor.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/ApolloCodegenLib/CLIExtractor.swift b/Sources/ApolloCodegenLib/CLIExtractor.swift index d57007a1cb..626ce13e12 100644 --- a/Sources/ApolloCodegenLib/CLIExtractor.swift +++ b/Sources/ApolloCodegenLib/CLIExtractor.swift @@ -118,9 +118,11 @@ struct CLIExtractor { CodegenLogger.log("Extracting CLI from zip file. This may take a second...") _ = try Basher.run(command: "tar xzf '\(zipFileURL.path)' -C '\(cliFolderURL.path)'", from: nil) - + let apolloFolderURL = ApolloFilePathHelper.apolloFolderURL(fromCLIFolder: cliFolderURL) let binaryFolderURL = ApolloFilePathHelper.binaryFolderURL(fromApollo: apolloFolderURL) + + _ = try Basher.run(command: "chmod -R 777 ./", from: apolloFolderURL) guard FileManager.default.apollo.folderExists(at: binaryFolderURL) else { throw CLIExtractorError.noBinaryFolderAfterUnzipping(atURL: binaryFolderURL) From 383b997c0ca519b613c420f963a353e88f597b57 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 14 Apr 2021 15:13:13 -0700 Subject: [PATCH 29/30] test not breaking lock --- Sources/ApolloCodegenLib/ApolloCLI.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/ApolloCodegenLib/ApolloCLI.swift b/Sources/ApolloCodegenLib/ApolloCLI.swift index 69c07d03eb..1275ddfe4e 100644 --- a/Sources/ApolloCodegenLib/ApolloCLI.swift +++ b/Sources/ApolloCodegenLib/ApolloCLI.swift @@ -35,7 +35,7 @@ public struct ApolloCLI { throw ApolloCLIError.lockInitializationFailed(cliFolderURL) } - let maxPollCount = Int(timeout/2) + let maxPollCount = Int(timeout*2) var pollCount = 0 repeat { @@ -47,11 +47,13 @@ public struct ApolloCLI { if pollCount <= maxPollCount { usleep(500_000) // sleep 0.5 seconds + } else { + throw ApolloCLIError.lockInitializationFailed(cliFolderURL) } } } while pollCount <= maxPollCount - lock.break() // After timeout, we force the lock. If another process failed and did not +// lock.break() // After timeout, we force the lock. If another process failed and did not // relinquish the lock, we should break the lock. return lock } From 4766d33a91678887e046ffa16ae4a81db9995172 Mon Sep 17 00:00:00 2001 From: Anthony Miller Date: Wed, 14 Apr 2021 15:40:50 -0700 Subject: [PATCH 30/30] Removed added logging and cleaned up lock code --- .circleci/config.yml | 4 ++-- Sources/ApolloCodegenLib/ApolloCLI.swift | 5 ++--- Sources/ApolloCodegenLib/CLIExtractor.swift | 4 ---- Sources/ApolloCodegenLib/FileManager+Apollo.swift | 2 -- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 71bfda6ebd..05946c6868 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -60,10 +60,10 @@ commands: command: sudo chmod -R +rwx SimpleUploadServer name: Adjust permissions for simple upload server folder - run: - command: xcodebuild clean build build-for-testing -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" + command: xcodebuild clean build build-for-testing -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" | xcpretty name: Clean and build for testing - run: - command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" -testPlan "${CIRCLE_XCODE_TEST_PLAN}" + command: xcodebuild test-without-building -resultBundlePath ~/TestResults/ResultBundle.xcresult -project "Apollo.xcodeproj" -scheme "${CIRCLE_XCODE_SCHEME}" -sdk "${CIRCLE_XCODE_SDK}" -destination "${DESTINATION}" -testPlan "${CIRCLE_XCODE_TEST_PLAN}" | xcpretty name: Run tests - save-xcodebuild-artifacts - save_cache: diff --git a/Sources/ApolloCodegenLib/ApolloCLI.swift b/Sources/ApolloCodegenLib/ApolloCLI.swift index 1275ddfe4e..36385d5b57 100644 --- a/Sources/ApolloCodegenLib/ApolloCLI.swift +++ b/Sources/ApolloCodegenLib/ApolloCLI.swift @@ -8,6 +8,7 @@ public struct ApolloCLI { enum ApolloCLIError: Error { case lockInitializationFailed(URL) + case timedOutWaitingOnLock(URL) } /// Creates an instance of `ApolloCLI`, downloading and extracting if needed @@ -48,13 +49,11 @@ public struct ApolloCLI { if pollCount <= maxPollCount { usleep(500_000) // sleep 0.5 seconds } else { - throw ApolloCLIError.lockInitializationFailed(cliFolderURL) + throw ApolloCLIError.timedOutWaitingOnLock(cliFolderURL) } } } while pollCount <= maxPollCount -// lock.break() // After timeout, we force the lock. If another process failed and did not - // relinquish the lock, we should break the lock. return lock } diff --git a/Sources/ApolloCodegenLib/CLIExtractor.swift b/Sources/ApolloCodegenLib/CLIExtractor.swift index 626ce13e12..e507a9d4a9 100644 --- a/Sources/ApolloCodegenLib/CLIExtractor.swift +++ b/Sources/ApolloCodegenLib/CLIExtractor.swift @@ -71,8 +71,6 @@ struct CLIExtractor { let contents = try String(contentsOf: shasumFileURL, encoding: .utf8) - CodegenLogger.log("Extracted zip SHASHUM: \(contents)") - guard contents == expected else { return contents.hasPrefix(expected) } @@ -121,8 +119,6 @@ struct CLIExtractor { let apolloFolderURL = ApolloFilePathHelper.apolloFolderURL(fromCLIFolder: cliFolderURL) let binaryFolderURL = ApolloFilePathHelper.binaryFolderURL(fromApollo: apolloFolderURL) - - _ = try Basher.run(command: "chmod -R 777 ./", from: apolloFolderURL) guard FileManager.default.apollo.folderExists(at: binaryFolderURL) else { throw CLIExtractorError.noBinaryFolderAfterUnzipping(atURL: binaryFolderURL) diff --git a/Sources/ApolloCodegenLib/FileManager+Apollo.swift b/Sources/ApolloCodegenLib/FileManager+Apollo.swift index 4e1385e872..4286996094 100644 --- a/Sources/ApolloCodegenLib/FileManager+Apollo.swift +++ b/Sources/ApolloCodegenLib/FileManager+Apollo.swift @@ -89,8 +89,6 @@ extension ApolloExtension where Base == FileManager { /// /// - Parameter fileURL: The file to calculate the SHASUM for. public func shasum(at fileURL: URL) throws -> String { - CodegenLogger.log("Checking SHASUM for file at URL: \(fileURL)") - let file = try FileHandle(forReadingFrom: fileURL) defer { file.closeFile()