From 1b841e77debca2425da2731fb0452c1e85a75545 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Tue, 18 Apr 2017 15:59:44 +0100 Subject: [PATCH] provider/aws: Run all AWSConfig acc tests sequentially (#13658) --- .../resource_aws_config_config_rule_test.go | 10 ++--- ...nfig_configuration_recorder_status_test.go | 6 +-- ..._aws_config_configuration_recorder_test.go | 6 +-- ...source_aws_config_delivery_channel_test.go | 6 +-- .../providers/aws/resource_aws_config_test.go | 44 +++++++++++++++++++ 5 files changed, 58 insertions(+), 14 deletions(-) create mode 100644 builtin/providers/aws/resource_aws_config_test.go diff --git a/builtin/providers/aws/resource_aws_config_config_rule_test.go b/builtin/providers/aws/resource_aws_config_config_rule_test.go index 6540fc5de..42f3047bd 100644 --- a/builtin/providers/aws/resource_aws_config_config_rule_test.go +++ b/builtin/providers/aws/resource_aws_config_config_rule_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform/terraform" ) -func TestAccAWSConfigConfigRule_basic(t *testing.T) { +func testAccConfigConfigRule_basic(t *testing.T) { var cr configservice.ConfigRule rInt := acctest.RandInt() expectedName := fmt.Sprintf("tf-acc-test-%d", rInt) @@ -37,7 +37,7 @@ func TestAccAWSConfigConfigRule_basic(t *testing.T) { }) } -func TestAccAWSConfigConfigRule_ownerAws(t *testing.T) { +func testAccConfigConfigRule_ownerAws(t *testing.T) { var cr configservice.ConfigRule rInt := acctest.RandInt() expectedName := fmt.Sprintf("tf-acc-test-%d", rInt) @@ -72,7 +72,7 @@ func TestAccAWSConfigConfigRule_ownerAws(t *testing.T) { }) } -func TestAccAWSConfigConfigRule_customlambda(t *testing.T) { +func testAccConfigConfigRule_customlambda(t *testing.T) { var cr configservice.ConfigRule rInt := acctest.RandInt() @@ -113,7 +113,7 @@ func TestAccAWSConfigConfigRule_customlambda(t *testing.T) { }) } -func TestAccAWSConfigConfigRule_importAws(t *testing.T) { +func testAccConfigConfigRule_importAws(t *testing.T) { resourceName := "aws_config_config_rule.foo" rInt := acctest.RandInt() @@ -135,7 +135,7 @@ func TestAccAWSConfigConfigRule_importAws(t *testing.T) { }) } -func TestAccAWSConfigConfigRule_importLambda(t *testing.T) { +func testAccConfigConfigRule_importLambda(t *testing.T) { resourceName := "aws_config_config_rule.foo" rInt := acctest.RandInt() diff --git a/builtin/providers/aws/resource_aws_config_configuration_recorder_status_test.go b/builtin/providers/aws/resource_aws_config_configuration_recorder_status_test.go index 3967bcb3a..ded0d16b4 100644 --- a/builtin/providers/aws/resource_aws_config_configuration_recorder_status_test.go +++ b/builtin/providers/aws/resource_aws_config_configuration_recorder_status_test.go @@ -11,7 +11,7 @@ import ( "github.com/hashicorp/terraform/terraform" ) -func TestAccAWSConfigConfigurationRecorderStatus_basic(t *testing.T) { +func testAccConfigConfigurationRecorderStatus_basic(t *testing.T) { var cr configservice.ConfigurationRecorder var crs configservice.ConfigurationRecorderStatus rInt := acctest.RandInt() @@ -36,7 +36,7 @@ func TestAccAWSConfigConfigurationRecorderStatus_basic(t *testing.T) { }) } -func TestAccAWSConfigConfigurationRecorderStatus_startEnabled(t *testing.T) { +func testAccConfigConfigurationRecorderStatus_startEnabled(t *testing.T) { var cr configservice.ConfigurationRecorder var crs configservice.ConfigurationRecorderStatus rInt := acctest.RandInt() @@ -81,7 +81,7 @@ func TestAccAWSConfigConfigurationRecorderStatus_startEnabled(t *testing.T) { }) } -func TestAccAWSConfigConfigurationRecorderStatus_importBasic(t *testing.T) { +func testAccConfigConfigurationRecorderStatus_importBasic(t *testing.T) { resourceName := "aws_config_configuration_recorder_status.foo" rInt := acctest.RandInt() diff --git a/builtin/providers/aws/resource_aws_config_configuration_recorder_test.go b/builtin/providers/aws/resource_aws_config_configuration_recorder_test.go index 8a7363d18..8180f6694 100644 --- a/builtin/providers/aws/resource_aws_config_configuration_recorder_test.go +++ b/builtin/providers/aws/resource_aws_config_configuration_recorder_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform/terraform" ) -func TestAccAWSConfigConfigurationRecorder_basic(t *testing.T) { +func testAccConfigConfigurationRecorder_basic(t *testing.T) { var cr configservice.ConfigurationRecorder rInt := acctest.RandInt() expectedName := fmt.Sprintf("tf-acc-test-%d", rInt) @@ -39,7 +39,7 @@ func TestAccAWSConfigConfigurationRecorder_basic(t *testing.T) { }) } -func TestAccAWSConfigConfigurationRecorder_allParams(t *testing.T) { +func testAccConfigConfigurationRecorder_allParams(t *testing.T) { var cr configservice.ConfigurationRecorder rInt := acctest.RandInt() expectedName := fmt.Sprintf("tf-acc-test-%d", rInt) @@ -70,7 +70,7 @@ func TestAccAWSConfigConfigurationRecorder_allParams(t *testing.T) { }) } -func TestAccAWSConfigConfigurationRecorder_importBasic(t *testing.T) { +func testAccConfigConfigurationRecorder_importBasic(t *testing.T) { resourceName := "aws_config_configuration_recorder.foo" rInt := acctest.RandInt() diff --git a/builtin/providers/aws/resource_aws_config_delivery_channel_test.go b/builtin/providers/aws/resource_aws_config_delivery_channel_test.go index 6f0d5fd4d..098465f9d 100644 --- a/builtin/providers/aws/resource_aws_config_delivery_channel_test.go +++ b/builtin/providers/aws/resource_aws_config_delivery_channel_test.go @@ -12,7 +12,7 @@ import ( "github.com/hashicorp/terraform/terraform" ) -func TestAccAWSConfigDeliveryChannel_basic(t *testing.T) { +func testAccConfigDeliveryChannel_basic(t *testing.T) { var dc configservice.DeliveryChannel rInt := acctest.RandInt() expectedName := fmt.Sprintf("tf-acc-test-awsconfig-%d", rInt) @@ -36,7 +36,7 @@ func TestAccAWSConfigDeliveryChannel_basic(t *testing.T) { }) } -func TestAccAWSConfigDeliveryChannel_allParams(t *testing.T) { +func testAccConfigDeliveryChannel_allParams(t *testing.T) { var dc configservice.DeliveryChannel rInt := acctest.RandInt() expectedName := fmt.Sprintf("tf-acc-test-awsconfig-%d", rInt) @@ -64,7 +64,7 @@ func TestAccAWSConfigDeliveryChannel_allParams(t *testing.T) { }) } -func TestAccAWSConfigDeliveryChannel_importBasic(t *testing.T) { +func testAccConfigDeliveryChannel_importBasic(t *testing.T) { resourceName := "aws_config_delivery_channel.foo" rInt := acctest.RandInt() diff --git a/builtin/providers/aws/resource_aws_config_test.go b/builtin/providers/aws/resource_aws_config_test.go new file mode 100644 index 000000000..f24424624 --- /dev/null +++ b/builtin/providers/aws/resource_aws_config_test.go @@ -0,0 +1,44 @@ +package aws + +import ( + "testing" +) + +func TestAccAWSConfig(t *testing.T) { + testCases := map[string]map[string]func(t *testing.T){ + "Config": { + "basic": testAccConfigConfigRule_basic, + "ownerAws": testAccConfigConfigRule_ownerAws, + "customlambda": testAccConfigConfigRule_customlambda, + "importAws": testAccConfigConfigRule_importAws, + "importLambda": testAccConfigConfigRule_importLambda, + }, + "ConfigurationRecorderStatus": { + "basic": testAccConfigConfigurationRecorderStatus_basic, + "startEnabled": testAccConfigConfigurationRecorderStatus_startEnabled, + "importBasic": testAccConfigConfigurationRecorderStatus_importBasic, + }, + "ConfigurationRecorder": { + "basic": testAccConfigConfigurationRecorder_basic, + "allParams": testAccConfigConfigurationRecorder_allParams, + "importBasic": testAccConfigConfigurationRecorder_importBasic, + }, + "DeliveryChannel": { + "basic": testAccConfigDeliveryChannel_basic, + "allParams": testAccConfigDeliveryChannel_allParams, + "importBasic": testAccConfigDeliveryChannel_importBasic, + }, + } + + for group, m := range testCases { + m := m + t.Run(group, func(t *testing.T) { + for name, tc := range m { + tc := tc + t.Run(name, func(t *testing.T) { + tc(t) + }) + } + }) + } +}