Skip to content

Commit

Permalink
Merge pull request #18193 from hashicorp/t-glue-errorcheck
Browse files Browse the repository at this point in the history
tests/glue: Add ErrorCheck (Part 1)
  • Loading branch information
YakDriver authored Mar 18, 2021
2 parents ab97cef + 306c0f1 commit 97822bc
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 4 deletions.
11 changes: 7 additions & 4 deletions aws/data_source_aws_glue_script_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import (
"regexp"
"testing"

"github.com/aws/aws-sdk-go/service/glue"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)

func TestAccDataSourceAWSGlueScript_Language_Python(t *testing.T) {
dataSourceName := "data.aws_glue_script.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccDataSourceAWSGlueScriptConfigPython(),
Expand All @@ -28,8 +30,9 @@ func TestAccDataSourceAWSGlueScript_Language_Scala(t *testing.T) {
dataSourceName := "data.aws_glue_script.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
Steps: []resource.TestStep{
{
Config: testAccDataSourceAWSGlueScriptConfigScala(),
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_glue_catalog_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func TestAccAWSGlueCatalogDatabase_full(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueDatabaseDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -119,6 +120,7 @@ func TestAccAWSGlueCatalogDatabase_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueDatabaseDestroy,
Steps: []resource.TestStep{
Expand Down
15 changes: 15 additions & 0 deletions aws/resource_aws_glue_catalog_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func TestAccAWSGlueCatalogTable_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -48,6 +49,7 @@ func TestAccAWSGlueCatalogTable_columnParameters(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -78,6 +80,7 @@ func TestAccAWSGlueCatalogTable_full(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -141,6 +144,7 @@ func TestAccAWSGlueCatalogTable_update_addValues(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -213,6 +217,7 @@ func TestAccAWSGlueCatalogTable_update_replaceValues(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -326,6 +331,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_EmptyConfigurationBlock(t *tes

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand All @@ -346,6 +352,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_SerDeInfo_EmptyConfigurationBl

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand All @@ -367,6 +374,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_SerDeInfo_UpdateValues(t *test

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -407,6 +415,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_SkewedInfo_EmptyConfigurationB

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand All @@ -428,6 +437,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_schemaReference(t *testing.T)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -458,6 +468,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_schemaReferenceArn(t *testing.

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -487,6 +498,7 @@ func TestAccAWSGlueCatalogTable_partitionIndexesSingle(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -517,6 +529,7 @@ func TestAccAWSGlueCatalogTable_partitionIndexesMultiple(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -550,6 +563,7 @@ func TestAccAWSGlueCatalogTable_disappears_database(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand All @@ -572,6 +586,7 @@ func TestAccAWSGlueCatalogTable_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckGlueTableDestroy,
Steps: []resource.TestStep{
Expand Down
8 changes: 8 additions & 0 deletions aws/resource_aws_glue_classifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func TestAccAWSGlueClassifier_CsvClassifier(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueClassifierDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -129,6 +130,7 @@ func TestAccAWSGlueClassifier_CsvClassifier_quoteSymbol(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueClassifierDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -165,6 +167,7 @@ func TestAccAWSGlueClassifier_GrokClassifier(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueClassifierDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -213,6 +216,7 @@ func TestAccAWSGlueClassifier_GrokClassifier_CustomPatterns(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueClassifierDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -261,6 +265,7 @@ func TestAccAWSGlueClassifier_JsonClassifier(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueClassifierDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -305,6 +310,7 @@ func TestAccAWSGlueClassifier_TypeChange(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueClassifierDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -373,6 +379,7 @@ func TestAccAWSGlueClassifier_XmlClassifier(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueClassifierDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -419,6 +426,7 @@ func TestAccAWSGlueClassifier_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueClassifierDestroy,
Steps: []resource.TestStep{
Expand Down
7 changes: 7 additions & 0 deletions aws/resource_aws_glue_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ func TestAccAWSGlueConnection_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueConnectionDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -98,6 +99,7 @@ func TestAccAWSGlueConnection_MongoDB(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueConnectionDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -131,6 +133,7 @@ func TestAccAWSGlueConnection_Kafka(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueConnectionDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -162,6 +165,7 @@ func TestAccAWSGlueConnection_Description(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueConnectionDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -196,6 +200,7 @@ func TestAccAWSGlueConnection_MatchCriteria(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueConnectionDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -245,6 +250,7 @@ func TestAccAWSGlueConnection_PhysicalConnectionRequirements(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueConnectionDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -281,6 +287,7 @@ func TestAccAWSGlueConnection_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, glue.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSGlueConnectionDestroy,
Steps: []resource.TestStep{
Expand Down
Loading

0 comments on commit 97822bc

Please sign in to comment.