Skip to content

Commit d91bbe4

Browse files
committed
provider/aws: Update Redshift SG Acctests
Allows redshift security group tests to better handle being ran in parallel. ``` $ make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSRedshiftSecurityGroup_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /terraform/vendor/) 2017/02/09 10:40:25 Generated command/internal_plugin_list.go TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSRedshiftSecurityGroup_ -timeout 120m === RUN TestAccAWSRedshiftSecurityGroup_importBasic --- PASS: TestAccAWSRedshiftSecurityGroup_importBasic (12.98s) === RUN TestAccAWSRedshiftSecurityGroup_ingressCidr --- PASS: TestAccAWSRedshiftSecurityGroup_ingressCidr (11.02s) === RUN TestAccAWSRedshiftSecurityGroup_updateIngressCidr --- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressCidr (32.81s) === RUN TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup --- PASS: TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup (14.82s) === RUN TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup --- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup (37.43s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 109.090s ```
1 parent 767764f commit d91bbe4

2 files changed

Lines changed: 184 additions & 167 deletions

File tree

builtin/providers/aws/import_aws_redshift_security_group_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@ import (
44
"os"
55
"testing"
66

7+
"github.com/hashicorp/terraform/helper/acctest"
78
"github.com/hashicorp/terraform/helper/resource"
89
)
910

1011
func TestAccAWSRedshiftSecurityGroup_importBasic(t *testing.T) {
1112
oldvar := os.Getenv("AWS_DEFAULT_REGION")
1213
os.Setenv("AWS_DEFAULT_REGION", "us-east-1")
1314
defer os.Setenv("AWS_DEFAULT_REGION", oldvar)
15+
rInt := acctest.RandInt()
1416

1517
resourceName := "aws_redshift_security_group.bar"
1618

@@ -19,11 +21,11 @@ func TestAccAWSRedshiftSecurityGroup_importBasic(t *testing.T) {
1921
Providers: testAccProviders,
2022
CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy,
2123
Steps: []resource.TestStep{
22-
resource.TestStep{
23-
Config: testAccAWSRedshiftSecurityGroupConfig_ingressCidr,
24+
{
25+
Config: testAccAWSRedshiftSecurityGroupConfig_ingressCidr(rInt),
2426
},
2527

26-
resource.TestStep{
28+
{
2729
ResourceName: resourceName,
2830
ImportState: true,
2931
ImportStateVerify: true,

0 commit comments

Comments
 (0)