From 143d14917bd69539da41e18121e3d709cc3cf030 Mon Sep 17 00:00:00 2001 From: Calvin Cestari Date: Wed, 13 Dec 2023 12:16:43 -0800 Subject: [PATCH] tests: TestCodegenConfigurations projects should fail on warnings (apollographql/apollo-ios-dev#198) --- .../EmbeddedInTarget-InSchemaModule/Package.swift | 3 --- .../EmbeddedInTarget-InSchemaModule/test-project.sh | 2 +- .../PackageOne/Package.swift | 3 --- .../PackageTwo/Package.swift | 3 --- .../EmbeddedInTarget-RelativeAbsolute/test-project.sh | 5 +++-- .../SwiftPackageManager/Package.swift | 3 --- .../SwiftPackageManager/test-project.sh | 2 +- apollo-ios/Sources/ApolloAPI/DataDict.swift | 1 - 8 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift index 0227cf207..b43316073 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/Package.swift @@ -23,9 +23,6 @@ let package = Package( name: "TestApp", dependencies: [ .product(name: "ApolloAPI", package: "apollo-ios") - ], - swiftSettings: [ - .unsafeFlags(["-warnings-as-errors"]) ]), .testTarget( name: "TestAppTests", diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/test-project.sh b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/test-project.sh index e3b25cd69..9093d6a49 100755 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/test-project.sh +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-InSchemaModule/test-project.sh @@ -1,3 +1,3 @@ #!/bin/bash -swift test +swift test -Xswiftc -warnings-as-errors diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift index e605c9f40..04f08a310 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageOne/Package.swift @@ -45,9 +45,6 @@ let package = Package( "graphql/PetDetails.graphql", "graphql/AllAnimalsIncludeSkipQuery.graphql", "graphql/PetAdoptionMutation.graphql" - ], - swiftSettings: [ - .unsafeFlags(["-warnings-as-errors"]) ]), .testTarget( name: "PackageOneTests", diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift index c4a017cbe..3ad6d14f2 100644 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/PackageTwo/Package.swift @@ -22,9 +22,6 @@ let package = Package( name: "PackageTwo", dependencies: [ .product(name: "ApolloAPI", package: "apollo-ios"), - ], - swiftSettings: [ - .unsafeFlags(["-warnings-as-errors"]) ]), .target( name: "TestMocks", diff --git a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/test-project.sh b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/test-project.sh index 29ccda806..bb8a4657a 100755 --- a/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/test-project.sh +++ b/Tests/TestCodeGenConfigurations/EmbeddedInTarget-RelativeAbsolute/test-project.sh @@ -1,9 +1,10 @@ #!/bin/bash +set -e echo "Testing PackageOne.." cd PackageOne -swift test +swift test -Xswiftc -warnings-as-errors echo "Testing PackageTwo.." cd ../PackageTwo -swift test +swift test -Xswiftc -warnings-as-errors diff --git a/Tests/TestCodeGenConfigurations/SwiftPackageManager/Package.swift b/Tests/TestCodeGenConfigurations/SwiftPackageManager/Package.swift index 3b2fb5eca..9a71cca28 100644 --- a/Tests/TestCodeGenConfigurations/SwiftPackageManager/Package.swift +++ b/Tests/TestCodeGenConfigurations/SwiftPackageManager/Package.swift @@ -23,9 +23,6 @@ let package = Package( dependencies: [ .product(name: "Apollo", package: "apollo-ios"), .product(name: "AnimalKingdomAPI", package: "AnimalKingdomAPI") - ], - swiftSettings: [ - .unsafeFlags(["-warnings-as-errors"]) ] ), .testTarget( diff --git a/Tests/TestCodeGenConfigurations/SwiftPackageManager/test-project.sh b/Tests/TestCodeGenConfigurations/SwiftPackageManager/test-project.sh index e3b25cd69..9093d6a49 100755 --- a/Tests/TestCodeGenConfigurations/SwiftPackageManager/test-project.sh +++ b/Tests/TestCodeGenConfigurations/SwiftPackageManager/test-project.sh @@ -1,3 +1,3 @@ #!/bin/bash -swift test +swift test -Xswiftc -warnings-as-errors diff --git a/apollo-ios/Sources/ApolloAPI/DataDict.swift b/apollo-ios/Sources/ApolloAPI/DataDict.swift index 1f2ba6719..539ca45f5 100644 --- a/apollo-ios/Sources/ApolloAPI/DataDict.swift +++ b/apollo-ios/Sources/ApolloAPI/DataDict.swift @@ -48,7 +48,6 @@ public struct DataDict: Hashable { _storage.deferredFragments } - #warning("TODO, remove deferredFragments default value when we set these up in executor") public init( data: [String: AnyHashable], fulfilledFragments: Set,