diff --git a/IntegrationTests/Services/AWSMediaConvertIntegrationTests/AWSMediaConvertTests.swift b/IntegrationTests/Services/AWSMediaConvertIntegrationTests/AWSMediaConvertTests.swift index 387c569e43b..5bca0f3ce4d 100644 --- a/IntegrationTests/Services/AWSMediaConvertIntegrationTests/AWSMediaConvertTests.swift +++ b/IntegrationTests/Services/AWSMediaConvertIntegrationTests/AWSMediaConvertTests.swift @@ -88,7 +88,8 @@ class AWSMediaConvertTests: XCTestCase { let input2 = GetJobTemplateInput(name: name) let output2 = try await client.getJobTemplate(input: input2) - // Verify the name of the retrieved template is the same as the - XCTAssertEqual(output2.jobTemplate?.name, name) + // Verify the name of the created & retrieved templates is the same as the original + XCTAssertEqual(output1.jobTemplate?.name, name) + XCTAssertEqual(output1.jobTemplate?.name, output2.jobTemplate?.name) } } diff --git a/IntegrationTests/Services/AWSS3IntegrationTests/S3StreamTests.swift b/IntegrationTests/Services/AWSS3IntegrationTests/S3StreamTests.swift index 03d22402d92..83864750e18 100644 --- a/IntegrationTests/Services/AWSS3IntegrationTests/S3StreamTests.swift +++ b/IntegrationTests/Services/AWSS3IntegrationTests/S3StreamTests.swift @@ -7,7 +7,7 @@ import XCTest import AWSS3 -import ClientRuntime +@testable import ClientRuntime final class S3StreamTests: S3XCTestCase { let objectName = "hello-world" @@ -43,7 +43,7 @@ final class S3StreamTests: S3XCTestCase { func test_putObject_givenStreamBody() async throws { let audioURL = Bundle.module.url(forResource: objectName, withExtension: nil)! let fileHandle = FileHandle(forReadingAtPath: audioURL.relativePath)! - let fileByteStream = try ByteStream.data(try fileHandle.readToEnd() ?? Data()) + let fileByteStream = ByteStream.stream(FileStream(fileHandle: fileHandle)) let input = PutObjectInput(body: fileByteStream, bucket: bucketName, key: objectName) let output = try await client.putObject(input: input) XCTAssertNotNil(output) diff --git a/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift b/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift index bf9a005b677..13af83cf57c 100644 --- a/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift +++ b/IntegrationTests/Services/AWSTranscribeStreamingIntegrationTests/TranscribeStreamingTests.swift @@ -12,11 +12,20 @@ import AWSTranscribeStreaming final class TranscribeStreamingTests: XCTestCase { func testStartStreamTranscription() async throws { + + // The heelo-swift.wav resource is an audio file that contains an automated voice + // saying the words "Hello transcribed streaming from Swift S. D. K.". + // It is 2.976 seconds in duration. let audioURL = Bundle.module.url(forResource: "hello-swift", withExtension: "wav")! let audioData = try Data(contentsOf: audioURL) + // A delay will be imposed between chunks to keep the audio streaming to the Teranscribe + // service at approximately real-time. + let duration = 2.976 let chunkSize = 4096 let audioDataSize = audioData.count + let dataRate = Double(audioDataSize) / duration + let delay = Double(chunkSize) / dataRate let client = try TranscribeStreamingClient(region: "us-west-2") @@ -26,6 +35,7 @@ final class TranscribeStreamingTests: XCTestCase { var currentEnd = min(chunkSize, audioDataSize - currentStart) while currentStart < audioDataSize { + if currentStart != 0 { try await Task.sleep(nanoseconds: UInt64(delay * 1_000_000_000)) } let dataChunk = audioData[currentStart ..< currentEnd] let audioEvent = TranscribeStreamingClientTypes.AudioStream.audioevent(.init(audioChunk: dataChunk)) diff --git a/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift b/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift index 2ec22d16b17..5b96651a09d 100644 --- a/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift +++ b/Sources/Core/AWSClientRuntime/AWSClientConfiguration.swift @@ -30,10 +30,12 @@ public class AWSClientConfiguration @@ -134,13 +131,8 @@ public class AWSClientConfiguration