Skip to content

Commit

Permalink
Fix TestListAPIGatewaysV2 test failures (#495)
Browse files Browse the repository at this point in the history
* Fix TestListAPIGatewaysV2 test failures

* fmt
  • Loading branch information
james03160927 authored Jul 11, 2023
1 parent 9e34c43 commit 0f34e76
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions aws/apigatewayv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ import (
"testing"
"time"

"github.com/aws/aws-sdk-go/aws"
awsgo "github.com/aws/aws-sdk-go/aws"
terratestaws "github.com/gruntwork-io/terratest/modules/aws"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/apigatewayv2"
"github.com/gruntwork-io/cloud-nuke/config"
Expand Down Expand Up @@ -46,8 +48,7 @@ func TestListAPIGatewaysV2(t *testing.T) {
telemetry.InitTelemetry("cloud-nuke", "")
t.Parallel()

region, err := getRandomRegion()
require.NoError(t, err)
region := terratestaws.GetRandomStableRegion(t, []string{"us-east-1", "us-east-2", "us-west-1"}, nil)
session, err := session.NewSession(&awsgo.Config{
Region: awsgo.String(region),
},
Expand All @@ -73,9 +74,7 @@ func TestListAPIGatewaysV2(t *testing.T) {
func TestTimeFilterExclusionNewlyCreatedAPIGatewayV2(t *testing.T) {
t.Parallel()

region, err := getRandomRegion()
require.NoError(t, err)

region := terratestaws.GetRandomStableRegion(t, []string{"us-east-1", "us-east-2", "us-west-1"}, nil)
session, err := session.NewSession(&aws.Config{Region: aws.String(region)})
require.NoError(t, err)

Expand All @@ -100,8 +99,7 @@ func TestTimeFilterExclusionNewlyCreatedAPIGatewayV2(t *testing.T) {
func TestNukeAPIGatewayV2One(t *testing.T) {
t.Parallel()

region, err := getRandomRegion()
require.NoError(t, err)
region := terratestaws.GetRandomStableRegion(t, []string{"us-east-1", "us-east-2", "us-west-1"}, nil)

session, err := session.NewSession(&aws.Config{Region: aws.String(region)})
require.NoError(t, err)
Expand All @@ -124,8 +122,7 @@ func TestNukeAPIGatewayV2One(t *testing.T) {
func TestNukeAPIGatewayV2MoreThanOne(t *testing.T) {
t.Parallel()

region, err := getRandomRegion()
require.NoError(t, err)
region := terratestaws.GetRandomStableRegion(t, []string{"us-east-1", "us-east-2", "us-west-1"}, nil)

session, err := session.NewSession(&aws.Config{Region: aws.String(region)})
require.NoError(t, err)
Expand Down

0 comments on commit 0f34e76

Please sign in to comment.