From 8b462ea877dae50dbbe996602719f8e4c9775903 Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Wed, 10 Jul 2024 21:31:20 -0500 Subject: [PATCH 1/2] Use TestInitializer to initialize CRT --- .../amazon/smithy/aws/swift/codegen/EndpointTestGenerator.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/EndpointTestGenerator.kt b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/EndpointTestGenerator.kt index 16f0cb4eaad..97044aa7269 100644 --- a/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/EndpointTestGenerator.kt +++ b/codegen/smithy-aws-swift-codegen/src/main/kotlin/software/amazon/smithy/aws/swift/codegen/EndpointTestGenerator.kt @@ -20,9 +20,9 @@ import software.amazon.smithy.swift.codegen.SwiftDependency import software.amazon.smithy.swift.codegen.SwiftWriter import software.amazon.smithy.swift.codegen.endpoints.EndpointTypes import software.amazon.smithy.swift.codegen.integration.ProtocolGenerator -import software.amazon.smithy.swift.codegen.swiftmodules.CRT import software.amazon.smithy.swift.codegen.swiftmodules.ClientRuntimeTypes import software.amazon.smithy.swift.codegen.swiftmodules.SmithyHTTPAPITypes +import software.amazon.smithy.swift.codegen.swiftmodules.SmithyTestUtilTypes import software.amazon.smithy.swift.codegen.swiftmodules.XCTestTypes import software.amazon.smithy.swift.codegen.utils.toLowerCamelCase @@ -47,7 +47,7 @@ class EndpointTestGenerator( writer.openBlock("class EndpointResolverTest: \$N {", "}", XCTestTypes.XCTestCase) { writer.write("") writer.openBlock("override class func setUp() {", "}") { - writer.write("\$N.initialize()", CRT.CommonRuntimeKit) + writer.write("\$N.initialize()", SmithyTestUtilTypes.TestInitializer) } writer.write("") From 9ce6353f87396959e34a8bf532cbb5ae30a0c285 Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Wed, 10 Jul 2024 21:45:00 -0500 Subject: [PATCH 2/2] Remove CRT from service client test dependencies --- .../Sources/AWSSDKSwiftCLI/Resources/Package.Base.swift | 2 +- Package.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.swift b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.swift index df346cdb2e1..2c450482787 100644 --- a/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.swift +++ b/AWSSDKSwiftCLI/Sources/AWSSDKSwiftCLI/Resources/Package.Base.swift @@ -223,7 +223,7 @@ func addServiceUnitTestTarget(_ name: String) { package.targets += [ .testTarget( name: "\(testName)", - dependencies: [.crt, .clientRuntime, .awsClientRuntime, .byName(name: name), .smithyTestUtils], + dependencies: [.clientRuntime, .awsClientRuntime, .byName(name: name), .smithyTestUtils], path: "Sources/Services/\(name)/Tests/\(testName)" ) ] diff --git a/Package.swift b/Package.swift index e9ff4f24d19..b7f4424aec9 100644 --- a/Package.swift +++ b/Package.swift @@ -223,7 +223,7 @@ func addServiceUnitTestTarget(_ name: String) { package.targets += [ .testTarget( name: "\(testName)", - dependencies: [.crt, .clientRuntime, .awsClientRuntime, .byName(name: name), .smithyTestUtils], + dependencies: [.clientRuntime, .awsClientRuntime, .byName(name: name), .smithyTestUtils], path: "Sources/Services/\(name)/Tests/\(testName)" ) ]