From e0f64500be98b2ee997a3bb71d1adc58c05be867 Mon Sep 17 00:00:00 2001 From: Calvin Cestari Date: Wed, 18 Sep 2024 10:15:54 -0700 Subject: [PATCH] ci: Remove boilerplate codegen tests and regenerate internal unit test projects (#484) --- .../AnimalKingdomAPI/Package.swift | 2 +- Sources/GitHubAPI/GitHubAPI/Package.swift | 2 +- Sources/StarWarsAPI/StarWarsAPI/Package.swift | 2 +- ...AndConditionalInclusionQuery.graphql.swift | 43 ++----------------- .../SubscriptionAPI/Package.swift | 2 +- Sources/UploadAPI/UploadAPI/Package.swift | 2 +- ...iftPackageManagerModuleTemplateTests.swift | 32 -------------- 7 files changed, 8 insertions(+), 77 deletions(-) diff --git a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Package.swift b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Package.swift index d65c7955e..65e14ac84 100644 --- a/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Package.swift +++ b/Sources/AnimalKingdomAPI/AnimalKingdomAPI/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version:5.9 import PackageDescription diff --git a/Sources/GitHubAPI/GitHubAPI/Package.swift b/Sources/GitHubAPI/GitHubAPI/Package.swift index 0dd5e1cef..4052fcd09 100644 --- a/Sources/GitHubAPI/GitHubAPI/Package.swift +++ b/Sources/GitHubAPI/GitHubAPI/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version:5.9 import PackageDescription diff --git a/Sources/StarWarsAPI/StarWarsAPI/Package.swift b/Sources/StarWarsAPI/StarWarsAPI/Package.swift index b8f38db9a..a73c57cdb 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Package.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version:5.9 import PackageDescription diff --git a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.graphql.swift b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.graphql.swift index 54cddca0b..96d48ff7c 100644 --- a/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.graphql.swift +++ b/Sources/StarWarsAPI/StarWarsAPI/Sources/Operations/Queries/HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.graphql.swift @@ -93,7 +93,6 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ public var name: String { __data["name"] } public var ifIncludeFriendsDetails: IfIncludeFriendsDetails? { _asInlineFragment() } - public var asDroid: AsDroid? { _asInlineFragment() } public init( __typename: String, @@ -145,7 +144,7 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ )) } - /// Hero.Friend.AsDroid + /// Hero.Friend.IfIncludeFriendsDetails.AsDroid /// /// Parent Type: `Droid` public struct AsDroid: StarWarsAPI.InlineFragment { @@ -175,49 +174,13 @@ public class HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery: GraphQ ], fulfilledFragments: [ ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.self), - ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.AsDroid.self) + ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.IfIncludeFriendsDetails.self), + ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.IfIncludeFriendsDetails.AsDroid.self) ] )) } } } - - /// Hero.Friend.AsDroid - /// - /// Parent Type: `Droid` - public struct AsDroid: StarWarsAPI.InlineFragment, ApolloAPI.CompositeInlineFragment { - public let __data: DataDict - public init(_dataDict: DataDict) { __data = _dataDict } - - public typealias RootEntityType = HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend - public static var __parentType: any ApolloAPI.ParentType { StarWarsAPI.Objects.Droid } - public static var __mergedSources: [any ApolloAPI.SelectionSet.Type] { [ - HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.self, - HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.AsDroid.self - ] } - - /// The name of the character - public var name: String { __data["name"] } - /// This droid's primary function - public var primaryFunction: String? { __data["primaryFunction"] } - - public init( - name: String, - primaryFunction: String? = nil - ) { - self.init(_dataDict: DataDict( - data: [ - "__typename": StarWarsAPI.Objects.Droid.typename, - "name": name, - "primaryFunction": primaryFunction, - ], - fulfilledFragments: [ - ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.self), - ObjectIdentifier(HeroFriendsDetailsUnconditionalAndConditionalInclusionQuery.Data.Hero.Friend.AsDroid.self) - ] - )) - } - } } } } diff --git a/Sources/SubscriptionAPI/SubscriptionAPI/Package.swift b/Sources/SubscriptionAPI/SubscriptionAPI/Package.swift index e9722b5f2..c35148e55 100644 --- a/Sources/SubscriptionAPI/SubscriptionAPI/Package.swift +++ b/Sources/SubscriptionAPI/SubscriptionAPI/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version:5.9 import PackageDescription diff --git a/Sources/UploadAPI/UploadAPI/Package.swift b/Sources/UploadAPI/UploadAPI/Package.swift index 39ef6e337..a8f2dda66 100644 --- a/Sources/UploadAPI/UploadAPI/Package.swift +++ b/Sources/UploadAPI/UploadAPI/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.7 +// swift-tools-version:5.9 import PackageDescription diff --git a/Tests/ApolloCodegenTests/CodeGeneration/Templates/SwiftPackageManagerModuleTemplateTests.swift b/Tests/ApolloCodegenTests/CodeGeneration/Templates/SwiftPackageManagerModuleTemplateTests.swift index a3ee0f932..d7962437b 100644 --- a/Tests/ApolloCodegenTests/CodeGeneration/Templates/SwiftPackageManagerModuleTemplateTests.swift +++ b/Tests/ApolloCodegenTests/CodeGeneration/Templates/SwiftPackageManagerModuleTemplateTests.swift @@ -27,38 +27,6 @@ class SwiftPackageManagerModuleTemplateTests: XCTestCase { return rendered } - // MARK: Boilerplate Tests - - func test__boilerplate__generatesCorrectSwiftToolsVersion() { - // given - buildSubject() - - let expected = """ - // swift-tools-version:5.7 - """ - - // when - let actual = renderSubject() - - // then - expect(actual).to(equalLineByLine(expected, ignoringExtraLines: true)) - } - - func test__boilerplate__generatesRequiredImports() { - // given - buildSubject() - - let expected = """ - import PackageDescription - """ - - // when - let actual = renderSubject() - - // then - expect(actual).to(equalLineByLine(expected, atLine: 3, ignoringExtraLines: true)) - } - // MARK: PackageDescription tests func test__packageDescription__givenLowercaseSchemaName_generatesPackageDefinitionWithCapitalizedName() {