Skip to content

Commit

Permalink
Use account ID in localstack queue tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffail committed Oct 30, 2023
1 parent 99899cc commit 8a06f92
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions internal/impl/aws/integration_aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand All @@ -51,23 +53,23 @@ 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)
}
}

if sqsClient != nil {
if _, err := sqsClient.CreateQueue(&sqs.CreateQueueInput{
QueueName: aws.String(sqsQueue),
}); err != nil {
return err
return fmt.Errorf("create queue: %w", err)
}
}

if s3Client != nil {
if err := s3Client.WaitUntilBucketExists(&s3.HeadBucketInput{
Bucket: &bucket,
}); err != nil {
return err
return fmt.Errorf("wait for bucket: %w", err)
}
}

Expand All @@ -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"]
}
Expand All @@ -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
Expand Down

0 comments on commit 8a06f92

Please sign in to comment.