Skip to content

Commit ac8ff1e

Browse files
authored
Revert "fix: Use full UUIDs for random identifiers in integration tests (#2043)" (#2044)
This reverts commit 7b481fa.
1 parent 7b481fa commit ac8ff1e

File tree

18 files changed

+69
-112
lines changed

18 files changed

+69
-112
lines changed

IntegrationTests/AWSIntegrationTestUtils/String+Identifier.swift

Lines changed: 0 additions & 32 deletions
This file was deleted.

IntegrationTests/Services/AWSCloudFrontKeyValueStoreIntegrationTests/CloudFrontKeyValueStoreSigV4ATests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import ClientRuntime
1111
import AWSClientRuntime
1212
import AWSCloudFront
1313
import AWSCloudFrontKeyValueStore
14-
import AWSIntegrationTestUtils
1514

1615
/// Tests SigV4a signing flow using CloudFrontKeyValueStore.
1716
class CloudFrontKeyValueStoreSigV4ATests: XCTestCase {
@@ -24,7 +23,7 @@ class CloudFrontKeyValueStoreSigV4ATests: XCTestCase {
2423
private let region = "us-east-1"
2524

2625
// Temporary name of the KVS to use for the test
27-
private let kvsName = String.uniqueID(service: "sigv4a-kvs")
26+
private let kvsName = "sigv4a-test-kvs-" + UUID().uuidString.split(separator: "-").first!.lowercased()
2827

2928
// The Etag to use to call CloudFront::deletKeyValueStore
3029
private var cfEtag: String!

IntegrationTests/Services/AWSCognitoIdentityIntegrationTests/CognitoAWSCredentialIdentityResolverTests.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,14 @@ import AWSSTS
1212
import ClientRuntime
1313
import SmithyWaitersAPI
1414
import XCTest
15-
import AWSIntegrationTestUtils
1615

1716
/// Tests CognitoAWSCredentialIdentityResolver using STS::getCallerIdentity.
1817
class CognitoAWSCredentialIdentityResolverTests: XCTestCase {
1918
private let region = "us-west-2"
2019

2120
private var cognitoIdentityClient: CognitoIdentityClient!
2221
private var iamClient: IAMClient!
23-
private let identityPoolName = String.uniqueID(service: "cognito")
22+
private let identityPoolName = "aws-cognito-integration-test-\(UUID().uuidString.split(separator: "-").first!.lowercased())"
2423
private var identityPoolId: String!
2524
private var roleName: String!
2625

@@ -39,7 +38,7 @@ class CognitoAWSCredentialIdentityResolverTests: XCTestCase {
3938
)
4039
).identityPoolId
4140
// Create an IAM role for unauthenticated users
42-
roleName = String.uniqueID(service: "cog-role")
41+
roleName = "CognitoUnauth_\(identityPoolName)"
4342
let trustPolicy = """
4443
{
4544
"Version": "2012-10-17",

IntegrationTests/Services/AWSCognitoIdentityIntegrationTests/UnauthenticatedAPITests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import AWSClientRuntime
1212
import ClientRuntime
1313
import class SmithyHTTPAPI.HTTPRequest
1414
import class SmithyHTTPAPI.HTTPResponse
15-
import AWSIntegrationTestUtils
1615

1716
/// Tests unauthenciated API using AWSCognitoIdentity::getId
1817
class UnauthenticatedAPITests: XCTestCase {
@@ -23,7 +22,7 @@ class UnauthenticatedAPITests: XCTestCase {
2322

2423
private var accountID: String!
2524
private var identityPoolID: String!
26-
private let identityPoolName = String.uniqueID(service: "idpool")
25+
private let identityPoolName = "idpool" + UUID().uuidString.split(separator: "-").first!.lowercased()
2726

2827
override func setUp() async throws {
2928
// STS client for getting the account ID, an input parameter for the unauthenticated API, getId().

IntegrationTests/Services/AWSEventBridgeIntegrationTests/EventBridgeSigV4ATests.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import AWSEventBridge
1111
import ClientRuntime
1212
import AWSClientRuntime
1313
import AWSRoute53
14-
import AWSIntegrationTestUtils
1514

1615
/// Tests SigV4a signing flow using EventBridge's global endpoint.
1716
class EventBridgeSigV4ATests: XCTestCase {
@@ -29,8 +28,8 @@ class EventBridgeSigV4ATests: XCTestCase {
2928
private let secondaryRegion = "us-east-1"
3029

3130
// Name for the EventBridge global endpoint
32-
private let endpointName = String.uniqueID(service: "eb-globalendpt")
33-
private let eventBusName = String.uniqueID(service: "eb-eventbus")
31+
private let endpointName = "sigv4a-test-global-endpoint-\(UUID().uuidString.split(separator: "-").first!.lowercased())"
32+
private let eventBusName = "sigv4a-integ-test-eventbus-\(UUID().uuidString.split(separator: "-").first!.lowercased())"
3433
private var endpointId: String!
3534

3635
private var healthCheckId: String!
@@ -59,7 +58,7 @@ class EventBridgeSigV4ATests: XCTestCase {
5958
type: .https
6059
)
6160
let createHealthCheckInput = CreateHealthCheckInput(
62-
callerReference: String.uniqueID(service: "r53-healthchk"),
61+
callerReference: UUID().uuidString.split(separator: "-").first!.lowercased(),
6362
healthCheckConfig: healthCheckConfig
6463
)
6564
let healthCheck = try await route53Client.createHealthCheck(input: createHealthCheckInput)

IntegrationTests/Services/AWSGlacierIntegrationTests/GlacierTests.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ import AWSGlacier
1111
import AWSSTS
1212
import enum Smithy.ByteStream
1313
import SmithyWaitersAPI
14-
import AWSIntegrationTestUtils
1514

1615
/// Tests that Glacier operations run successfully
1716
class GlacierTests: XCTestCase {
1817
var glacierClient: GlacierClient!
1918
var stsClient: STSClient!
2019
var accountId: String!
2120
var archiveId: String!
22-
let vaultName = String.uniqueID(service: "s3-glacier")
21+
let vaultName = UUID().uuidString.split(separator: "-").first!.lowercased() + "integ-test-vault"
2322

2423
override func setUp() async throws {
2524
stsClient = try STSClient(region: "us-east-1")

IntegrationTests/Services/AWSKinesisIntegrationTests/KinesisTests.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import AWSKinesis
1010
import ClientRuntime
1111
import AWSClientRuntime
1212
import SmithyWaitersAPI
13-
import AWSIntegrationTestUtils
1413

1514
class KinesisTests: XCTestCase {
1615

@@ -24,7 +23,7 @@ class KinesisTests: XCTestCase {
2423
// Client must have AWS credentials set that allow access to the Kinesis service.
2524
// Resources will be cleaned up before the test concludes, pass or fail, unless the test crashes.
2625

27-
let streamName = String.uniqueID(service: "kinesis")
26+
let streamName = UUID().uuidString
2827
let client = try KinesisClient(region: "us-west-2")
2928

3029
do {
@@ -37,7 +36,7 @@ class KinesisTests: XCTestCase {
3736
let streamARN = stream.streamDescription?.streamARN
3837

3938
// Make a set of 10 records, add them to the stream
40-
var recordStrings = (1...10).map { _ in String.uniqueID(service: "kinesis") }
39+
var recordStrings = (1...10).map { _ in UUID().uuidString }
4140
for record in recordStrings {
4241
let putRecordInput = PutRecordInput(data: record.data(using: .utf8), explicitHashKey: nil, partitionKey: "Test", sequenceNumberForOrdering: nil, streamName: streamName)
4342
let _ = try await client.putRecord(input: putRecordInput)
@@ -49,7 +48,7 @@ class KinesisTests: XCTestCase {
4948
let shard = shardList.shards?.first!
5049

5150
// Create a consumer for the shard
52-
let consumerName = String.uniqueID(service: "kinesis")
51+
let consumerName = UUID().uuidString
5352
let consumerInput = RegisterStreamConsumerInput(consumerName: consumerName, streamARN: stream.streamDescription?.streamARN)
5453
let consumer = try await client.registerStreamConsumer(input: consumerInput)
5554
let consumerARN = consumer.consumer?.consumerARN

IntegrationTests/Services/AWSS3IntegrationTests/S3ConcurrentTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,18 @@ final class S3ConcurrentTests: S3XCTestCase, @unchecked Sendable {
4141
// Puts data to S3, gets the uploaded file, asserts retrieved data == original data, deletes S3 object
4242
@Sendable
4343
private func getObject(data: Data) async throws {
44-
let objectKey = String.uniqueID(service: "s3")
45-
let putObjectInput = PutObjectInput(body: .data(data), bucket: bucketName, key: objectKey)
44+
let objectKey = UUID().uuidString.split(separator: "-").first!.lowercased()
45+
let putObjectInput = PutObjectInput(body: .data(data), bucket: bucketName, key: objectKey)
4646

47-
_ = try await client.putObject(input: putObjectInput)
47+
_ = try await client.putObject(input: putObjectInput)
4848

49-
let retrievedData = try await client.getObject(input: GetObjectInput(
50-
bucket: bucketName, key: objectKey
51-
)).body?.readData()
49+
let retrievedData = try await client.getObject(input: GetObjectInput(
50+
bucket: bucketName, key: objectKey
51+
)).body?.readData()
5252

53-
XCTAssertEqual(data, retrievedData)
53+
XCTAssertEqual(data, retrievedData)
5454

55-
let deleteObjectInput = DeleteObjectInput(bucket: bucketName, key: objectKey)
56-
_ = try await client.deleteObject(input: deleteObjectInput)
55+
let deleteObjectInput = DeleteObjectInput(bucket: bucketName, key: objectKey)
56+
_ = try await client.deleteObject(input: deleteObjectInput)
5757
}
5858
}

IntegrationTests/Services/AWSS3IntegrationTests/S3ContentMD5HeaderTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class S3ContentMD5HeaderTests: S3XCTestCase {
1717
try await super.setUp()
1818
// Generate 3 UUIDs to use as object keys and save them
1919
for _ in 1...3 {
20-
objectKeys.append(String.uniqueID(service: "s3"))
20+
objectKeys.append("key-\(UUID().uuidString.split(separator: "-").first!.lowercased())")
2121
}
2222
}
2323

IntegrationTests/Services/AWSS3IntegrationTests/S3EmptyBody404Tests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class S3EmptyBody404Tests: S3XCTestCase {
3030

3131
// Perform the S3 HeadObject operation on a nonexistent object.
3232
// This will cause the 404 error without a body.
33-
let input = HeadObjectInput(bucket: bucketName, key: String.uniqueID(service: "s3"))
33+
let input = HeadObjectInput(bucket: bucketName, key: UUID().uuidString)
3434
_ = try await client.headObject(input: input)
3535

3636
// If an error was not thrown by the HeadObject call, fail the test.

0 commit comments

Comments
 (0)