Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TestListAPIGatewaysV2 test failures #495

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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