From 6e7804bef0ed327f42298ecc538250996e638b96 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 20 Oct 2021 09:07:28 -0400 Subject: [PATCH 1/6] Serialize appsync tests - APIKey. --- internal/service/appsync/api_key_test.go | 12 +++++------ internal/service/appsync/appsync_test.go | 27 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 internal/service/appsync/appsync_test.go diff --git a/internal/service/appsync/api_key_test.go b/internal/service/appsync/api_key_test.go index 0fc607d9ca2..d01182f91c9 100644 --- a/internal/service/appsync/api_key_test.go +++ b/internal/service/appsync/api_key_test.go @@ -17,13 +17,13 @@ import ( tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" ) -func TestAccAppSyncAPIKey_basic(t *testing.T) { +func testAccAppSyncAPIKey_basic(t *testing.T) { var apiKey appsync.ApiKey dateAfterSevenDays := time.Now().UTC().Add(time.Hour * 24 * time.Duration(7)).Truncate(time.Hour) resourceName := "aws_appsync_api_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -47,12 +47,12 @@ func TestAccAppSyncAPIKey_basic(t *testing.T) { }) } -func TestAccAppSyncAPIKey_description(t *testing.T) { +func testAccAppSyncAPIKey_description(t *testing.T) { var apiKey appsync.ApiKey resourceName := "aws_appsync_api_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -81,14 +81,14 @@ func TestAccAppSyncAPIKey_description(t *testing.T) { }) } -func TestAccAppSyncAPIKey_expires(t *testing.T) { +func testAccAppSyncAPIKey_expires(t *testing.T) { var apiKey appsync.ApiKey dateAfterTenDays := time.Now().UTC().Add(time.Hour * 24 * time.Duration(10)).Truncate(time.Hour) dateAfterTwentyDays := time.Now().UTC().Add(time.Hour * 24 * time.Duration(20)).Truncate(time.Hour) resourceName := "aws_appsync_api_key.test" rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, diff --git a/internal/service/appsync/appsync_test.go b/internal/service/appsync/appsync_test.go new file mode 100644 index 00000000000..5582564f38d --- /dev/null +++ b/internal/service/appsync/appsync_test.go @@ -0,0 +1,27 @@ +package appsync_test + +import ( + "testing" +) + +func TestAccAppSync_serial(t *testing.T) { + testCases := map[string]map[string]func(t *testing.T){ + "APIKey": { + "basic": testAccAppSyncAPIKey_basic, + "description": testAccAppSyncAPIKey_description, + "expires": testAccAppSyncAPIKey_expires, + }, + } + + 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) + }) + } + }) + } +} From 9cb7c14d00ef0e9cff74dc077fccc436c6735090 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 20 Oct 2021 09:10:53 -0400 Subject: [PATCH 2/6] Serialize appsync tests - Resolver. --- internal/service/appsync/appsync_test.go | 11 +++++++ internal/service/appsync/resolver_test.go | 36 +++++++++++------------ 2 files changed, 29 insertions(+), 18 deletions(-) diff --git a/internal/service/appsync/appsync_test.go b/internal/service/appsync/appsync_test.go index 5582564f38d..581bca08cde 100644 --- a/internal/service/appsync/appsync_test.go +++ b/internal/service/appsync/appsync_test.go @@ -11,6 +11,17 @@ func TestAccAppSync_serial(t *testing.T) { "description": testAccAppSyncAPIKey_description, "expires": testAccAppSyncAPIKey_expires, }, + "Resolver": { + "basic": testAccAppSyncResolver_basic, + "disappears": testAccAppSyncResolver_disappears, + "dataSource": testAccAppSyncResolver_dataSource, + "DataSource_lambda": testAccAppSyncResolver_DataSource_lambda, + "requestTemplate": testAccAppSyncResolver_requestTemplate, + "responseTemplate": testAccAppSyncResolver_responseTemplate, + "multipleResolvers": testAccAppSyncResolver_multipleResolvers, + "pipeline": testAccAppSyncResolver_pipeline, + "caching": testAccAppSyncResolver_caching, + }, } for group, m := range testCases { diff --git a/internal/service/appsync/resolver_test.go b/internal/service/appsync/resolver_test.go index 3b3cc44ff76..9585329f5ae 100644 --- a/internal/service/appsync/resolver_test.go +++ b/internal/service/appsync/resolver_test.go @@ -16,12 +16,12 @@ import ( tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" ) -func TestAccAppSyncResolver_basic(t *testing.T) { +func testAccAppSyncResolver_basic(t *testing.T) { var resolver1 appsync.Resolver rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_resolver.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -45,14 +45,14 @@ func TestAccAppSyncResolver_basic(t *testing.T) { }) } -func TestAccAppSyncResolver_disappears(t *testing.T) { +func testAccAppSyncResolver_disappears(t *testing.T) { var api1 appsync.GraphqlApi var resolver1 appsync.Resolver rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) appsyncGraphqlApiResourceName := "aws_appsync_graphql_api.test" resourceName := "aws_appsync_resolver.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -71,12 +71,12 @@ func TestAccAppSyncResolver_disappears(t *testing.T) { }) } -func TestAccAppSyncResolver_dataSource(t *testing.T) { +func testAccAppSyncResolver_dataSource(t *testing.T) { var resolver1, resolver2 appsync.Resolver rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_resolver.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -105,12 +105,12 @@ func TestAccAppSyncResolver_dataSource(t *testing.T) { }) } -func TestAccAppSyncResolver_DataSource_lambda(t *testing.T) { +func testAccAppSyncResolver_DataSource_lambda(t *testing.T) { var resolver appsync.Resolver rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_resolver.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -132,12 +132,12 @@ func TestAccAppSyncResolver_DataSource_lambda(t *testing.T) { }) } -func TestAccAppSyncResolver_requestTemplate(t *testing.T) { +func testAccAppSyncResolver_requestTemplate(t *testing.T) { var resolver1, resolver2 appsync.Resolver rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_resolver.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -166,12 +166,12 @@ func TestAccAppSyncResolver_requestTemplate(t *testing.T) { }) } -func TestAccAppSyncResolver_responseTemplate(t *testing.T) { +func testAccAppSyncResolver_responseTemplate(t *testing.T) { var resolver1, resolver2 appsync.Resolver rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_resolver.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -200,12 +200,12 @@ func TestAccAppSyncResolver_responseTemplate(t *testing.T) { }) } -func TestAccAppSyncResolver_multipleResolvers(t *testing.T) { +func testAccAppSyncResolver_multipleResolvers(t *testing.T) { var resolver appsync.Resolver rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_resolver.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -230,12 +230,12 @@ func TestAccAppSyncResolver_multipleResolvers(t *testing.T) { }) } -func TestAccAppSyncResolver_pipeline(t *testing.T) { +func testAccAppSyncResolver_pipeline(t *testing.T) { var resolver appsync.Resolver rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_resolver.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -258,12 +258,12 @@ func TestAccAppSyncResolver_pipeline(t *testing.T) { }) } -func TestAccAppSyncResolver_caching(t *testing.T) { +func testAccAppSyncResolver_caching(t *testing.T) { var resolver appsync.Resolver rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_resolver.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, From a545d04e14272ef42773608a90fc44ad047732d8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 20 Oct 2021 09:13:13 -0400 Subject: [PATCH 3/6] Serialize appsync tests - Function. --- internal/service/appsync/appsync_test.go | 6 ++++++ internal/service/appsync/function_test.go | 16 ++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/internal/service/appsync/appsync_test.go b/internal/service/appsync/appsync_test.go index 581bca08cde..4e3f8cfe3ff 100644 --- a/internal/service/appsync/appsync_test.go +++ b/internal/service/appsync/appsync_test.go @@ -11,6 +11,12 @@ func TestAccAppSync_serial(t *testing.T) { "description": testAccAppSyncAPIKey_description, "expires": testAccAppSyncAPIKey_expires, }, + "Function": { + "basic": testAccAppSyncFunction_basic, + "disappears": testAccAppSyncFunction_disappears, + "description": testAccAppSyncFunction_description, + "responseMappingTemplate": testAccAppSyncFunction_responseMappingTemplate, + }, "Resolver": { "basic": testAccAppSyncResolver_basic, "disappears": testAccAppSyncResolver_disappears, diff --git a/internal/service/appsync/function_test.go b/internal/service/appsync/function_test.go index d1c1b437a9c..35364fe3b74 100644 --- a/internal/service/appsync/function_test.go +++ b/internal/service/appsync/function_test.go @@ -16,14 +16,14 @@ import ( tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" ) -func TestAccAppSyncFunction_basic(t *testing.T) { +func testAccAppSyncFunction_basic(t *testing.T) { rName1 := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) rName2 := fmt.Sprintf("tfexample%s", sdkacctest.RandString(8)) rName3 := fmt.Sprintf("tfexample%s", sdkacctest.RandString(8)) resourceName := "aws_appsync_function.test" var config appsync.FunctionConfiguration - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -56,13 +56,13 @@ func TestAccAppSyncFunction_basic(t *testing.T) { }) } -func TestAccAppSyncFunction_description(t *testing.T) { +func testAccAppSyncFunction_description(t *testing.T) { rName1 := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) rName2 := fmt.Sprintf("tfexample%s", sdkacctest.RandString(8)) resourceName := "aws_appsync_function.test" var config appsync.FunctionConfiguration - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -91,13 +91,13 @@ func TestAccAppSyncFunction_description(t *testing.T) { }) } -func TestAccAppSyncFunction_responseMappingTemplate(t *testing.T) { +func testAccAppSyncFunction_responseMappingTemplate(t *testing.T) { rName1 := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) rName2 := fmt.Sprintf("tfexample%s", sdkacctest.RandString(8)) resourceName := "aws_appsync_function.test" var config appsync.FunctionConfiguration - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -118,13 +118,13 @@ func TestAccAppSyncFunction_responseMappingTemplate(t *testing.T) { }) } -func TestAccAppSyncFunction_disappears(t *testing.T) { +func testAccAppSyncFunction_disappears(t *testing.T) { rName1 := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) rName2 := fmt.Sprintf("tfexample%s", sdkacctest.RandString(8)) resourceName := "aws_appsync_function.test" var config appsync.FunctionConfiguration - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, From 7ae224a7c1550517481d7df20c972ed752b04d21 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 20 Oct 2021 09:17:22 -0400 Subject: [PATCH 4/6] Serialize appsync tests - Data source. --- internal/service/appsync/appsync_test.go | 14 ++++++ internal/service/appsync/datasource_test.go | 48 ++++++++++----------- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/internal/service/appsync/appsync_test.go b/internal/service/appsync/appsync_test.go index 4e3f8cfe3ff..627cdbb248f 100644 --- a/internal/service/appsync/appsync_test.go +++ b/internal/service/appsync/appsync_test.go @@ -11,6 +11,20 @@ func TestAccAppSync_serial(t *testing.T) { "description": testAccAppSyncAPIKey_description, "expires": testAccAppSyncAPIKey_expires, }, + "DataSource": { + "basic": testAccAppSyncDataSource_basic, + "description": testAccAppSyncDataSource_description, + "DynamoDB_region": testAccAppSyncDataSource_DynamoDB_region, + "DynamoDB_useCallerCredentials": testAccAppSyncDataSource_DynamoDB_useCallerCredentials, + "ElasticSearch_region": testAccAppSyncDataSource_ElasticSearch_region, + "HTTP_endpoint": testAccAppSyncDataSource_HTTP_endpoint, + "type": testAccAppSyncDataSource_type, + "Type_dynamoDB": testAccAppSyncDataSource_Type_dynamoDB, + "Type_elasticSearch": testAccAppSyncDataSource_Type_elasticSearch, + "Type_http": testAccAppSyncDataSource_Type_http, + "Type_lambda": testAccAppSyncDataSource_Type_lambda, + "Type_none": testAccAppSyncDataSource_Type_none, + }, "Function": { "basic": testAccAppSyncFunction_basic, "disappears": testAccAppSyncFunction_disappears, diff --git a/internal/service/appsync/datasource_test.go b/internal/service/appsync/datasource_test.go index b8aa1589a16..28e23f6f7c7 100644 --- a/internal/service/appsync/datasource_test.go +++ b/internal/service/appsync/datasource_test.go @@ -16,11 +16,11 @@ import ( tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" ) -func TestAccAppSyncDataSource_basic(t *testing.T) { +func testAccAppSyncDataSource_basic(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -49,11 +49,11 @@ func TestAccAppSyncDataSource_basic(t *testing.T) { }) } -func TestAccAppSyncDataSource_description(t *testing.T) { +func testAccAppSyncDataSource_description(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -82,11 +82,11 @@ func TestAccAppSyncDataSource_description(t *testing.T) { }) } -func TestAccAppSyncDataSource_DynamoDB_region(t *testing.T) { +func testAccAppSyncDataSource_DynamoDB_region(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -117,11 +117,11 @@ func TestAccAppSyncDataSource_DynamoDB_region(t *testing.T) { }) } -func TestAccAppSyncDataSource_DynamoDB_useCallerCredentials(t *testing.T) { +func testAccAppSyncDataSource_DynamoDB_useCallerCredentials(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -152,11 +152,11 @@ func TestAccAppSyncDataSource_DynamoDB_useCallerCredentials(t *testing.T) { }) } -func TestAccAppSyncDataSource_ElasticSearch_region(t *testing.T) { +func testAccAppSyncDataSource_ElasticSearch_region(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -187,11 +187,11 @@ func TestAccAppSyncDataSource_ElasticSearch_region(t *testing.T) { }) } -func TestAccAppSyncDataSource_HTTP_endpoint(t *testing.T) { +func testAccAppSyncDataSource_HTTP_endpoint(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -224,11 +224,11 @@ func TestAccAppSyncDataSource_HTTP_endpoint(t *testing.T) { }) } -func TestAccAppSyncDataSource_type(t *testing.T) { +func testAccAppSyncDataSource_type(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -252,13 +252,13 @@ func TestAccAppSyncDataSource_type(t *testing.T) { }) } -func TestAccAppSyncDataSource_Type_dynamoDB(t *testing.T) { +func testAccAppSyncDataSource_Type_dynamoDB(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) dynamodbTableResourceName := "aws_dynamodb_table.test" iamRoleResourceName := "aws_iam_role.test" resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -284,12 +284,12 @@ func TestAccAppSyncDataSource_Type_dynamoDB(t *testing.T) { }) } -func TestAccAppSyncDataSource_Type_elasticSearch(t *testing.T) { +func testAccAppSyncDataSource_Type_elasticSearch(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) iamRoleResourceName := "aws_iam_role.test" resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -315,11 +315,11 @@ func TestAccAppSyncDataSource_Type_elasticSearch(t *testing.T) { }) } -func TestAccAppSyncDataSource_Type_http(t *testing.T) { +func testAccAppSyncDataSource_Type_http(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -343,13 +343,13 @@ func TestAccAppSyncDataSource_Type_http(t *testing.T) { }) } -func TestAccAppSyncDataSource_Type_lambda(t *testing.T) { +func testAccAppSyncDataSource_Type_lambda(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) iamRoleResourceName := "aws_iam_role.test" lambdaFunctionResourceName := "aws_lambda_function.test" resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -374,11 +374,11 @@ func TestAccAppSyncDataSource_Type_lambda(t *testing.T) { }) } -func TestAccAppSyncDataSource_Type_none(t *testing.T) { +func testAccAppSyncDataSource_Type_none(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, From 6a3bd5de876b8855e38be56541f2081e7e767464 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 20 Oct 2021 09:26:42 -0400 Subject: [PATCH 5/6] Serialize appsync tests - GraphQLAPI. --- internal/service/appsync/appsync_test.go | 27 +++++ internal/service/appsync/graphql_api_test.go | 100 +++++++++---------- 2 files changed, 77 insertions(+), 50 deletions(-) diff --git a/internal/service/appsync/appsync_test.go b/internal/service/appsync/appsync_test.go index 627cdbb248f..a0c31abb6d3 100644 --- a/internal/service/appsync/appsync_test.go +++ b/internal/service/appsync/appsync_test.go @@ -25,6 +25,33 @@ func TestAccAppSync_serial(t *testing.T) { "Type_lambda": testAccAppSyncDataSource_Type_lambda, "Type_none": testAccAppSyncDataSource_Type_none, }, + "GraphQLAPI": { + "basic": testAccAppSyncGraphQLAPI_basic, + "disappears": testAccAppSyncGraphQLAPI_disappears, + "schema": testAccAppSyncGraphQLAPI_schema, + "authenticationType": testAccAppSyncGraphQLAPI_authenticationType, + "AuthenticationType_apiKey": testAccAppSyncGraphQLAPI_AuthenticationType_apiKey, + "AuthenticationType_awsIAM": testAccAppSyncGraphQLAPI_AuthenticationType_awsIAM, + "AuthenticationType_amazonCognitoUserPools": testAccAppSyncGraphQLAPI_AuthenticationType_amazonCognitoUserPools, + "AuthenticationType_openIDConnect": testAccAppSyncGraphQLAPI_AuthenticationType_openIDConnect, + "log": testAccAppSyncGraphQLAPI_log, + "Log_fieldLogLevel": testAccAppSyncGraphQLAPI_Log_fieldLogLevel, + "Log_excludeVerboseContent": testAccAppSyncGraphQLAPI_Log_excludeVerboseContent, + "OpenIDConnect_authTTL": testAccAppSyncGraphQLAPI_OpenIDConnect_authTTL, + "OpenIDConnect_clientID": testAccAppSyncGraphQLAPI_OpenIDConnect_clientID, + "OpenIDConnect_iatTTL": testAccAppSyncGraphQLAPI_OpenIDConnect_iatTTL, + "OpenIDConnect_issuer": testAccAppSyncGraphQLAPI_OpenIDConnect_issuer, + "name": testAccAppSyncGraphQLAPI_name, + "UserPool_awsRegion": testAccAppSyncGraphQLAPI_UserPool_awsRegion, + "UserPool_defaultAction": testAccAppSyncGraphQLAPI_UserPool_defaultAction, + "tags": testAccAppSyncGraphQLAPI_tags, + "AdditionalAuthentication_apiKey": testAccAppSyncGraphQLAPI_AdditionalAuthentication_apiKey, + "AdditionalAuthentication_awsIAM": testAccAppSyncGraphQLAPI_AdditionalAuthentication_awsIAM, + "AdditionalAuthentication_cognitoUserPools": testAccAppSyncGraphQLAPI_AdditionalAuthentication_cognitoUserPools, + "AdditionalAuthentication_openIDConnect": testAccAppSyncGraphQLAPI_AdditionalAuthentication_openIDConnect, + "AdditionalAuthentication_multiple": testAccAppSyncGraphQLAPI_AdditionalAuthentication_multiple, + "xrayEnabled": testAccAppSyncGraphQLAPI_xrayEnabled, + }, "Function": { "basic": testAccAppSyncFunction_basic, "disappears": testAccAppSyncFunction_disappears, diff --git a/internal/service/appsync/graphql_api_test.go b/internal/service/appsync/graphql_api_test.go index 41eea14e68b..c3d6ed0cf22 100644 --- a/internal/service/appsync/graphql_api_test.go +++ b/internal/service/appsync/graphql_api_test.go @@ -16,12 +16,12 @@ import ( tfappsync "github.com/hashicorp/terraform-provider-aws/internal/service/appsync" ) -func TestAccAppSyncGraphQLAPI_basic(t *testing.T) { +func testAccAppSyncGraphQLAPI_basic(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -53,12 +53,12 @@ func TestAccAppSyncGraphQLAPI_basic(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_disappears(t *testing.T) { +func testAccAppSyncGraphQLAPI_disappears(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -76,12 +76,12 @@ func TestAccAppSyncGraphQLAPI_disappears(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_schema(t *testing.T) { +func testAccAppSyncGraphQLAPI_schema(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -121,12 +121,12 @@ func TestAccAppSyncGraphQLAPI_schema(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_authenticationType(t *testing.T) { +func testAccAppSyncGraphQLAPI_authenticationType(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -155,12 +155,12 @@ func TestAccAppSyncGraphQLAPI_authenticationType(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_AuthenticationType_apiKey(t *testing.T) { +func testAccAppSyncGraphQLAPI_AuthenticationType_apiKey(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -184,12 +184,12 @@ func TestAccAppSyncGraphQLAPI_AuthenticationType_apiKey(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_AuthenticationType_awsIAM(t *testing.T) { +func testAccAppSyncGraphQLAPI_AuthenticationType_awsIAM(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -213,13 +213,13 @@ func TestAccAppSyncGraphQLAPI_AuthenticationType_awsIAM(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_AuthenticationType_amazonCognitoUserPools(t *testing.T) { +func testAccAppSyncGraphQLAPI_AuthenticationType_amazonCognitoUserPools(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) cognitoUserPoolResourceName := "aws_cognito_user_pool.test" resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -245,12 +245,12 @@ func TestAccAppSyncGraphQLAPI_AuthenticationType_amazonCognitoUserPools(t *testi }) } -func TestAccAppSyncGraphQLAPI_AuthenticationType_openIDConnect(t *testing.T) { +func testAccAppSyncGraphQLAPI_AuthenticationType_openIDConnect(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -274,13 +274,13 @@ func TestAccAppSyncGraphQLAPI_AuthenticationType_openIDConnect(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_log(t *testing.T) { +func testAccAppSyncGraphQLAPI_log(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) iamRoleResourceName := "aws_iam_role.test" resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -305,13 +305,13 @@ func TestAccAppSyncGraphQLAPI_log(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_Log_fieldLogLevel(t *testing.T) { +func testAccAppSyncGraphQLAPI_Log_fieldLogLevel(t *testing.T) { var api1, api2, api3 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) iamRoleResourceName := "aws_iam_role.test" resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -356,13 +356,13 @@ func TestAccAppSyncGraphQLAPI_Log_fieldLogLevel(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_Log_excludeVerboseContent(t *testing.T) { +func testAccAppSyncGraphQLAPI_Log_excludeVerboseContent(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) iamRoleResourceName := "aws_iam_role.test" resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -398,12 +398,12 @@ func TestAccAppSyncGraphQLAPI_Log_excludeVerboseContent(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_OpenIDConnect_authTTL(t *testing.T) { +func testAccAppSyncGraphQLAPI_OpenIDConnect_authTTL(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -438,12 +438,12 @@ func TestAccAppSyncGraphQLAPI_OpenIDConnect_authTTL(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_OpenIDConnect_clientID(t *testing.T) { +func testAccAppSyncGraphQLAPI_OpenIDConnect_clientID(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -478,12 +478,12 @@ func TestAccAppSyncGraphQLAPI_OpenIDConnect_clientID(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_OpenIDConnect_iatTTL(t *testing.T) { +func testAccAppSyncGraphQLAPI_OpenIDConnect_iatTTL(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -518,12 +518,12 @@ func TestAccAppSyncGraphQLAPI_OpenIDConnect_iatTTL(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_OpenIDConnect_issuer(t *testing.T) { +func testAccAppSyncGraphQLAPI_OpenIDConnect_issuer(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -556,13 +556,13 @@ func TestAccAppSyncGraphQLAPI_OpenIDConnect_issuer(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_name(t *testing.T) { +func testAccAppSyncGraphQLAPI_name(t *testing.T) { var api1, api2 appsync.GraphqlApi rName1 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) rName2 := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -586,13 +586,13 @@ func TestAccAppSyncGraphQLAPI_name(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_UserPool_awsRegion(t *testing.T) { +func testAccAppSyncGraphQLAPI_UserPool_awsRegion(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) cognitoUserPoolResourceName := "aws_cognito_user_pool.test" resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -629,13 +629,13 @@ func TestAccAppSyncGraphQLAPI_UserPool_awsRegion(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_UserPool_defaultAction(t *testing.T) { +func testAccAppSyncGraphQLAPI_UserPool_defaultAction(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) cognitoUserPoolResourceName := "aws_cognito_user_pool.test" resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -672,12 +672,12 @@ func TestAccAppSyncGraphQLAPI_UserPool_defaultAction(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_tags(t *testing.T) { +func testAccAppSyncGraphQLAPI_tags(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -713,12 +713,12 @@ func TestAccAppSyncGraphQLAPI_tags(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_apiKey(t *testing.T) { +func testAccAppSyncGraphQLAPI_AdditionalAuthentication_apiKey(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -746,12 +746,12 @@ func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_apiKey(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_awsIAM(t *testing.T) { +func testAccAppSyncGraphQLAPI_AdditionalAuthentication_awsIAM(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -779,13 +779,13 @@ func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_awsIAM(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_cognitoUserPools(t *testing.T) { +func testAccAppSyncGraphQLAPI_AdditionalAuthentication_cognitoUserPools(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) cognitoUserPoolResourceName := "aws_cognito_user_pool.test" resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -814,12 +814,12 @@ func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_cognitoUserPools(t *testi }) } -func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_openIDConnect(t *testing.T) { +func testAccAppSyncGraphQLAPI_AdditionalAuthentication_openIDConnect(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -848,13 +848,13 @@ func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_openIDConnect(t *testing. }) } -func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_multiple(t *testing.T) { +func testAccAppSyncGraphQLAPI_AdditionalAuthentication_multiple(t *testing.T) { var api1 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) cognitoUserPoolResourceName := "aws_cognito_user_pool.test" resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -890,12 +890,12 @@ func TestAccAppSyncGraphQLAPI_AdditionalAuthentication_multiple(t *testing.T) { }) } -func TestAccAppSyncGraphQLAPI_xrayEnabled(t *testing.T) { +func testAccAppSyncGraphQLAPI_xrayEnabled(t *testing.T) { var api1, api2 appsync.GraphqlApi rName := sdkacctest.RandomWithPrefix(acctest.ResourcePrefix) resourceName := "aws_appsync_graphql_api.test" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, From cadd2e5932d0fa372f344abcb558bde8d5668932 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 20 Oct 2021 11:10:07 -0400 Subject: [PATCH 6/6] Keep the long-running Elasticsearch tests as independent, parallel tests. --- internal/service/appsync/appsync_test.go | 2 -- internal/service/appsync/datasource_test.go | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/service/appsync/appsync_test.go b/internal/service/appsync/appsync_test.go index a0c31abb6d3..d111faf7133 100644 --- a/internal/service/appsync/appsync_test.go +++ b/internal/service/appsync/appsync_test.go @@ -16,11 +16,9 @@ func TestAccAppSync_serial(t *testing.T) { "description": testAccAppSyncDataSource_description, "DynamoDB_region": testAccAppSyncDataSource_DynamoDB_region, "DynamoDB_useCallerCredentials": testAccAppSyncDataSource_DynamoDB_useCallerCredentials, - "ElasticSearch_region": testAccAppSyncDataSource_ElasticSearch_region, "HTTP_endpoint": testAccAppSyncDataSource_HTTP_endpoint, "type": testAccAppSyncDataSource_type, "Type_dynamoDB": testAccAppSyncDataSource_Type_dynamoDB, - "Type_elasticSearch": testAccAppSyncDataSource_Type_elasticSearch, "Type_http": testAccAppSyncDataSource_Type_http, "Type_lambda": testAccAppSyncDataSource_Type_lambda, "Type_none": testAccAppSyncDataSource_Type_none, diff --git a/internal/service/appsync/datasource_test.go b/internal/service/appsync/datasource_test.go index 28e23f6f7c7..5f74ad9d3a5 100644 --- a/internal/service/appsync/datasource_test.go +++ b/internal/service/appsync/datasource_test.go @@ -152,11 +152,12 @@ func testAccAppSyncDataSource_DynamoDB_useCallerCredentials(t *testing.T) { }) } -func testAccAppSyncDataSource_ElasticSearch_region(t *testing.T) { +func TestAccAppSyncDataSource_ElasticSearch_region(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) resourceName := "aws_appsync_datasource.test" - resource.Test(t, resource.TestCase{ + // Keep this test Parallel as it takes considerably longer to run than any non-Elasticsearch tests. + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers, @@ -284,12 +285,13 @@ func testAccAppSyncDataSource_Type_dynamoDB(t *testing.T) { }) } -func testAccAppSyncDataSource_Type_elasticSearch(t *testing.T) { +func TestAccAppSyncDataSource_Type_elasticSearch(t *testing.T) { rName := fmt.Sprintf("tfacctest%d", sdkacctest.RandInt()) iamRoleResourceName := "aws_iam_role.test" resourceName := "aws_appsync_datasource.test" - resource.Test(t, resource.TestCase{ + // Keep this test Parallel as it takes considerably longer to run than any non-Elasticsearch tests. + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acctest.PreCheck(t); acctest.PreCheckPartitionHasService(appsync.EndpointsID, t) }, ErrorCheck: acctest.ErrorCheck(t, appsync.EndpointsID), Providers: acctest.Providers,