Skip to content

Commit

Permalink
r/aws_lb: Remove 'testing.Short' from acceptance tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Dec 8, 2023
1 parent fb2c4b6 commit f193acc
Showing 1 changed file with 26 additions and 89 deletions.
115 changes: 26 additions & 89 deletions internal/service/elbv2/load_balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,6 @@ func TestAccELBV2LoadBalancer_NetworkLoadBalancer_updateCrossZone(t *testing.T)
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID),
Expand Down Expand Up @@ -649,10 +645,6 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateHTTP2(t *testing.T)
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID),
Expand Down Expand Up @@ -693,10 +685,7 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateDropInvalidHeaderFie
ctx := acctest.Context(t)
var pre, mid, post elbv2.LoadBalancer
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}
resourceName := "aws_lb.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
Expand All @@ -707,26 +696,26 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateDropInvalidHeaderFie
{
Config: testAccLoadBalancerConfig_enableDropInvalidHeaderFields(rName, false),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, "aws_lb.test", &pre),
testAccCheckLoadBalancerAttribute(ctx, "aws_lb.test", "routing.http.drop_invalid_header_fields.enabled", "false"),
resource.TestCheckResourceAttr("aws_lb.test", "drop_invalid_header_fields", "false"),
testAccCheckLoadBalancerExists(ctx, resourceName, &pre),
testAccCheckLoadBalancerAttribute(ctx, resourceName, "routing.http.drop_invalid_header_fields.enabled", "false"),
resource.TestCheckResourceAttr(resourceName, "drop_invalid_header_fields", "false"),
),
},
{
Config: testAccLoadBalancerConfig_enableDropInvalidHeaderFields(rName, true),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, "aws_lb.test", &mid),
testAccCheckLoadBalancerAttribute(ctx, "aws_lb.test", "routing.http.drop_invalid_header_fields.enabled", "true"),
resource.TestCheckResourceAttr("aws_lb.test", "drop_invalid_header_fields", "true"),
testAccCheckLoadBalancerExists(ctx, resourceName, &mid),
testAccCheckLoadBalancerAttribute(ctx, resourceName, "routing.http.drop_invalid_header_fields.enabled", "true"),
resource.TestCheckResourceAttr(resourceName, "drop_invalid_header_fields", "true"),
testAccCheckLoadBalancerNotRecreated(&pre, &mid),
),
},
{
Config: testAccLoadBalancerConfig_enableDropInvalidHeaderFields(rName, false),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, "aws_lb.test", &post),
testAccCheckLoadBalancerAttribute(ctx, "aws_lb.test", "routing.http.drop_invalid_header_fields.enabled", "false"),
resource.TestCheckResourceAttr("aws_lb.test", "drop_invalid_header_fields", "false"),
testAccCheckLoadBalancerExists(ctx, resourceName, &post),
testAccCheckLoadBalancerAttribute(ctx, resourceName, "routing.http.drop_invalid_header_fields.enabled", "false"),
resource.TestCheckResourceAttr(resourceName, "drop_invalid_header_fields", "false"),
testAccCheckLoadBalancerNotRecreated(&mid, &post),
),
},
Expand All @@ -738,10 +727,7 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updatePreserveHostHeader(t
ctx := acctest.Context(t)
var pre, mid, post elbv2.LoadBalancer
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}
resourceName := "aws_lb.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
Expand All @@ -752,26 +738,26 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updatePreserveHostHeader(t
{
Config: testAccLoadBalancerConfig_enablePreserveHostHeader(rName, false),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, "aws_lb.test", &pre),
testAccCheckLoadBalancerAttribute(ctx, "aws_lb.test", "routing.http.preserve_host_header.enabled", "false"),
resource.TestCheckResourceAttr("aws_lb.test", "preserve_host_header", "false"),
testAccCheckLoadBalancerExists(ctx, resourceName, &pre),
testAccCheckLoadBalancerAttribute(ctx, resourceName, "routing.http.preserve_host_header.enabled", "false"),
resource.TestCheckResourceAttr(resourceName, "preserve_host_header", "false"),
),
},
{
Config: testAccLoadBalancerConfig_enablePreserveHostHeader(rName, true),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, "aws_lb.test", &mid),
testAccCheckLoadBalancerAttribute(ctx, "aws_lb.test", "routing.http.preserve_host_header.enabled", "true"),
resource.TestCheckResourceAttr("aws_lb.test", "preserve_host_header", "true"),
testAccCheckLoadBalancerExists(ctx, resourceName, &mid),
testAccCheckLoadBalancerAttribute(ctx, resourceName, "routing.http.preserve_host_header.enabled", "true"),
resource.TestCheckResourceAttr(resourceName, "preserve_host_header", "true"),
testAccCheckLoadBalancerNotRecreated(&pre, &mid),
),
},
{
Config: testAccLoadBalancerConfig_enablePreserveHostHeader(rName, false),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, "aws_lb.test", &post),
testAccCheckLoadBalancerAttribute(ctx, "aws_lb.test", "routing.http.preserve_host_header.enabled", "false"),
resource.TestCheckResourceAttr("aws_lb.test", "preserve_host_header", "false"),
testAccCheckLoadBalancerExists(ctx, resourceName, &post),
testAccCheckLoadBalancerAttribute(ctx, resourceName, "routing.http.preserve_host_header.enabled", "false"),
resource.TestCheckResourceAttr(resourceName, "preserve_host_header", "false"),
testAccCheckLoadBalancerNotRecreated(&mid, &post),
),
},
Expand All @@ -785,10 +771,6 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateDeletionProtection(t
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID),
Expand Down Expand Up @@ -831,10 +813,6 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateWAFFailOpen(t *testi
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID),
Expand Down Expand Up @@ -909,12 +887,7 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updatedSecurityGroups(t *t
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

resource.ParallelTest(t, resource.TestCase{

PreCheck: func() {
acctest.PreCheck(ctx, t)
// GovCloud Regions don't always have 3 AZs.
Expand Down Expand Up @@ -951,10 +924,6 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_updateSubnets(t *testing.T
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
acctest.PreCheck(ctx, t)
Expand Down Expand Up @@ -1024,10 +993,6 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_accessLogs(t *testing.T) {
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID),
Expand Down Expand Up @@ -1101,10 +1066,6 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_accessLogsPrefix(t *testin
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"

if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acctest.PreCheck(ctx, t) },
ErrorCheck: acctest.ErrorCheck(t, elbv2.EndpointsID),
Expand Down Expand Up @@ -1161,10 +1122,6 @@ func TestAccELBV2LoadBalancer_ApplicationLoadBalancer_accessLogsPrefix(t *testin

func TestAccELBV2LoadBalancer_NetworkLoadBalancer_accessLogs(t *testing.T) {
ctx := acctest.Context(t)
if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

var conf elbv2.LoadBalancer
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"
Expand Down Expand Up @@ -1245,10 +1202,6 @@ func TestAccELBV2LoadBalancer_NetworkLoadBalancer_accessLogs(t *testing.T) {

func TestAccELBV2LoadBalancer_NetworkLoadBalancer_accessLogsPrefix(t *testing.T) {
ctx := acctest.Context(t)
if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

var conf elbv2.LoadBalancer
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"
Expand Down Expand Up @@ -1413,7 +1366,7 @@ func TestAccELBV2LoadBalancer_NetworkLoadBalancer_updateSecurityGroups(t *testin

func TestAccELBV2LoadBalancer_NetworkLoadBalancer_enforcePrivateLink(t *testing.T) {
ctx := acctest.Context(t)
var lb1 elbv2.LoadBalancer
var lb elbv2.LoadBalancer
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"

Expand All @@ -1432,7 +1385,7 @@ func TestAccELBV2LoadBalancer_NetworkLoadBalancer_enforcePrivateLink(t *testing.
{
Config: testAccLoadBalancerConfig_nlbSecurityGroupsEnforcePrivateLink(rName, 1, "off"),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, resourceName, &lb1),
testAccCheckLoadBalancerExists(ctx, resourceName, &lb),
resource.TestCheckResourceAttr(resourceName, "security_groups.#", "1"),
resource.TestCheckResourceAttr(resourceName, "enforce_security_group_inbound_rules_on_private_link_traffic", "off")),
},
Expand All @@ -1445,31 +1398,31 @@ func TestAccELBV2LoadBalancer_NetworkLoadBalancer_enforcePrivateLink(t *testing.
{
Config: testAccLoadBalancerConfig_nlbSecurityGroups(rName, 1),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, resourceName, &lb1),
testAccCheckLoadBalancerExists(ctx, resourceName, &lb),
resource.TestCheckResourceAttr(resourceName, "security_groups.#", "1"),
resource.TestCheckResourceAttr(resourceName, "enforce_security_group_inbound_rules_on_private_link_traffic", "off"),
),
},
{
Config: testAccLoadBalancerConfig_nlbSecurityGroupsEnforcePrivateLink(rName, 1, "on"),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, resourceName, &lb1),
testAccCheckLoadBalancerExists(ctx, resourceName, &lb),
resource.TestCheckResourceAttr(resourceName, "security_groups.#", "1"),
resource.TestCheckResourceAttr(resourceName, "enforce_security_group_inbound_rules_on_private_link_traffic", "on"),
),
},
{
Config: testAccLoadBalancerConfig_nlbSecurityGroupsEnforcePrivateLink(rName, 1, "off"),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, resourceName, &lb1),
testAccCheckLoadBalancerExists(ctx, resourceName, &lb),
resource.TestCheckResourceAttr(resourceName, "security_groups.#", "1"),
resource.TestCheckResourceAttr(resourceName, "enforce_security_group_inbound_rules_on_private_link_traffic", "off"),
),
},
{
Config: testAccLoadBalancerConfig_nlbSecurityGroups(rName, 1),
Check: resource.ComposeAggregateTestCheckFunc(
testAccCheckLoadBalancerExists(ctx, resourceName, &lb1),
testAccCheckLoadBalancerExists(ctx, resourceName, &lb),
resource.TestCheckResourceAttr(resourceName, "security_groups.#", "1"),
resource.TestCheckResourceAttr(resourceName, "enforce_security_group_inbound_rules_on_private_link_traffic", "off"),
),
Expand Down Expand Up @@ -1515,10 +1468,6 @@ func TestAccELBV2LoadBalancer_NetworkLoadBalancer_updateSubnets(t *testing.T) {

func TestAccELBV2LoadBalancer_updateDesyncMitigationMode(t *testing.T) {
ctx := acctest.Context(t)
if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

var pre, mid, post elbv2.LoadBalancer
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"
Expand Down Expand Up @@ -1564,10 +1513,6 @@ func TestAccELBV2LoadBalancer_updateDesyncMitigationMode(t *testing.T) {

func TestAccELBV2LoadBalancer_ALB_updateTLSVersionAndCipherSuite(t *testing.T) {
ctx := acctest.Context(t)
if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

var conf elbv2.LoadBalancer
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"
Expand Down Expand Up @@ -1613,10 +1558,6 @@ func TestAccELBV2LoadBalancer_ALB_updateTLSVersionAndCipherSuite(t *testing.T) {

func TestAccELBV2LoadBalancer_ALB_updateXffHeaderProcessingMode(t *testing.T) {
ctx := acctest.Context(t)
if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

var conf elbv2.LoadBalancer
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"
Expand Down Expand Up @@ -1662,10 +1603,6 @@ func TestAccELBV2LoadBalancer_ALB_updateXffHeaderProcessingMode(t *testing.T) {

func TestAccELBV2LoadBalancer_ALB_updateXffClientPort(t *testing.T) {
ctx := acctest.Context(t)
if testing.Short() {
t.Skip("skipping long-running test in short mode")
}

var conf elbv2.LoadBalancer
rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix)
resourceName := "aws_lb.test"
Expand Down

0 comments on commit f193acc

Please sign in to comment.