From 8a06f92f492e4aad78192fe9d3f7c7bbf30c854a Mon Sep 17 00:00:00 2001 From: Ashley Jeffs Date: Mon, 30 Oct 2023 17:03:09 +0000 Subject: [PATCH] Use account ID in localstack queue tests --- internal/impl/aws/integration_aws_test.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/internal/impl/aws/integration_aws_test.go b/internal/impl/aws/integration_aws_test.go index 5ad03ea6aa..ab66beaf25 100644 --- a/internal/impl/aws/integration_aws_test.go +++ b/internal/impl/aws/integration_aws_test.go @@ -26,7 +26,9 @@ func createBucketQueue(s3Port, sqsPort, id string) error { bucket := "bucket-" + id sqsQueue := "queue-" + id sqsEndpoint := fmt.Sprintf("http://localhost:%v", sqsPort) - sqsQueueURL := fmt.Sprintf("%v/queue/%v", sqsEndpoint, sqsQueue) + // sqsQueueURL := fmt.Sprintf("%v/queue/%v", sqsEndpoint, sqsQueue) + // https://github.com/localstack/localstack/issues/9185 + sqsQueueURL := fmt.Sprintf("%v/000000000000/%v", sqsEndpoint, sqsQueue) var s3Client *s3.S3 if s3Port != "" { @@ -51,7 +53,7 @@ func createBucketQueue(s3Port, sqsPort, id string) error { if _, err := s3Client.CreateBucket(&s3.CreateBucketInput{ Bucket: &bucket, }); err != nil { - return err + return fmt.Errorf("create bucket: %w", err) } } @@ -59,7 +61,7 @@ func createBucketQueue(s3Port, sqsPort, id string) error { if _, err := sqsClient.CreateQueue(&sqs.CreateQueueInput{ QueueName: aws.String(sqsQueue), }); err != nil { - return err + return fmt.Errorf("create queue: %w", err) } } @@ -67,7 +69,7 @@ func createBucketQueue(s3Port, sqsPort, id string) error { if err := s3Client.WaitUntilBucketExists(&s3.HeadBucketInput{ Bucket: &bucket, }); err != nil { - return err + return fmt.Errorf("wait for bucket: %w", err) } } @@ -78,7 +80,7 @@ func createBucketQueue(s3Port, sqsPort, id string) error { AttributeNames: []*string{aws.String("All")}, }) if err != nil { - return err + return fmt.Errorf("get queue attributes: %w", err) } sqsQueueArn = res.Attributes["QueueArn"] } @@ -97,7 +99,7 @@ func createBucketQueue(s3Port, sqsPort, id string) error { }, }, }); err != nil { - return err + return fmt.Errorf("put bucket notification config: %w", err) } } return nil