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

tests/opsworks: Add ErrorCheck (Part 2) #18196

Merged
merged 8 commits into from
Mar 18, 2021
2 changes: 2 additions & 0 deletions aws/resource_aws_opsworks_nodejs_app_layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestAccAWSOpsworksNodejsAppLayer_basic(t *testing.T) {
resourceName := "aws_opsworks_nodejs_app_layer.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksNodejsAppLayerDestroy,
Steps: []resource.TestStep{
Expand All @@ -38,6 +39,7 @@ func TestAccAWSOpsworksNodejsAppLayer_tags(t *testing.T) {
resourceName := "aws_opsworks_nodejs_app_layer.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksNodejsAppLayerDestroy,
Steps: []resource.TestStep{
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_opsworks_permission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestAccAWSOpsworksPermission_basic(t *testing.T) {
var opsperm opsworks.Permission
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksPermissionDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -100,6 +101,7 @@ func TestAccAWSOpsworksPermission_Self(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: nil, // Cannot delete own OpsWorks Permission
Steps: []resource.TestStep{
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_opsworks_php_app_layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestAccAWSOpsworksPhpAppLayer_basic(t *testing.T) {
resourceName := "aws_opsworks_php_app_layer.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksPhpAppLayerDestroy,
Steps: []resource.TestStep{
Expand All @@ -43,6 +44,7 @@ func TestAccAWSOpsworksPhpAppLayer_tags(t *testing.T) {
resourceName := "aws_opsworks_php_app_layer.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksPhpAppLayerDestroy,
Steps: []resource.TestStep{
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_opsworks_rails_app_layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestAccAWSOpsworksRailsAppLayer_basic(t *testing.T) {
resourceName := "aws_opsworks_rails_app_layer.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksRailsAppLayerDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -48,6 +49,7 @@ func TestAccAWSOpsworksRailsAppLayer_tags(t *testing.T) {
resourceName := "aws_opsworks_rails_app_layer.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksRailsAppLayerDestroy,
Steps: []resource.TestStep{
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_opsworks_rds_db_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestAccAWSOpsworksRdsDbInstance_basic(t *testing.T) {
var opsdb opsworks.RdsDbInstance
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksRdsDbDestroy,
Steps: []resource.TestStep{
Expand Down
5 changes: 5 additions & 0 deletions aws/resource_aws_opsworks_stack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestAccAWSOpsworksStack_noVpcBasic(t *testing.T) {
testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t)
testAccPreCheckAWSOpsWorksStacks(t)
},
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksStackDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -57,6 +58,7 @@ func TestAccAWSOpsworksStack_noVpcChangeServiceRoleForceNew(t *testing.T) {
testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t)
testAccPreCheckAWSOpsWorksStacks(t)
},
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksStackDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -93,6 +95,7 @@ func TestAccAWSOpsworksStack_vpc(t *testing.T) {
testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t)
testAccPreCheckAWSOpsWorksStacks(t)
},
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksStackDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -141,6 +144,7 @@ func TestAccAWSOpsworksStack_noVpcCreateTags(t *testing.T) {
testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t)
testAccPreCheckAWSOpsWorksStacks(t)
},
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksStackDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -184,6 +188,7 @@ func TestAccAWSOpsworksStack_CustomCookbooks_SetPrivateProperties(t *testing.T)
testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t)
testAccPreCheckAWSOpsWorksStacks(t)
},
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksStackDestroy,
Steps: []resource.TestStep{
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_opsworks_static_web_layer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestAccAWSOpsworksStaticWebLayer_basic(t *testing.T) {
resourceName := "aws_opsworks_static_web_layer.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksStaticWebLayerDestroy,
Steps: []resource.TestStep{
Expand All @@ -43,6 +44,7 @@ func TestAccAWSOpsworksStaticWebLayer_tags(t *testing.T) {
resourceName := "aws_opsworks_static_web_layer.test"
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksStaticWebLayerDestroy,
Steps: []resource.TestStep{
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_opsworks_user_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestAccAWSOpsworksUserProfile_basic(t *testing.T) {
updateRName := fmt.Sprintf("test-user-%d", acctest.RandInt())
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) },
ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsOpsworksUserProfileDestroy,
Steps: []resource.TestStep{
Expand Down