provider/aws: Run all AWSConfig acc tests sequentially (#13658)

This commit is contained in:
Radek Simko 2017-04-18 15:59:44 +01:00 committed by Paul Stack
parent 5b0ea5abff
commit 1b841e77de
5 changed files with 58 additions and 14 deletions

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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()

View File

@ -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)
})
}
})
}
}