diff --git a/pkg/acceptance/bettertestspoc/config/model/schema_model_ext.go b/pkg/acceptance/bettertestspoc/config/model/schema_model_ext.go deleted file mode 100644 index 8b53790705..0000000000 --- a/pkg/acceptance/bettertestspoc/config/model/schema_model_ext.go +++ /dev/null @@ -1 +0,0 @@ -package model diff --git a/pkg/resources/object_renaming_acceptance_test.go b/pkg/resources/object_renaming_acceptance_test.go index 516481e421..a74523e3eb 100644 --- a/pkg/resources/object_renaming_acceptance_test.go +++ b/pkg/resources/object_renaming_acceptance_test.go @@ -192,7 +192,7 @@ func TestAcc_ShallowHierarchy_IsInConfig_RenamedInternally_WithoutDependency_Aft TerraformVersionChecks: []tfversion.TerraformVersionCheck{ tfversion.RequireAbove(tfversion.Version1_5_0), }, - CheckDestroy: resource.ComposeAggregateTestCheckFunc(), + CheckDestroy: acc.CheckDestroy(t, resources.Schema), Steps: []resource.TestStep{ { Config: config.FromModels(t, databaseConfigModel, schemaModelConfig), @@ -404,8 +404,8 @@ func TestAcc_ShallowHierarchy_IsInConfig_RenamedExternally_WithImplicitDependenc }, ConfigPlanChecks: resource.ConfigPlanChecks{ PreApply: []plancheck.PlanCheck{ - plancheck.ExpectResourceAction("snowflake_database.test", plancheck.ResourceActionCreate), - plancheck.ExpectResourceAction("snowflake_schema.test", plancheck.ResourceActionCreate), + plancheck.ExpectResourceAction("snowflake_database.test", plancheck.ResourceActionCreate), // Create is expected, because in refresh Read before apply the database is removing the unknown database from the state using d.SetId("") after failed ShowByID + plancheck.ExpectResourceAction("snowflake_schema.test", plancheck.ResourceActionCreate), // Create is expected, because in refresh Read before apply the schema is removing the unknown schema from the state using d.SetId("") after failed ShowByID }, }, Config: config.FromModel(t, databaseConfigModelWithNewId) + configSchemaWithDatabaseReference(databaseConfigModelWithNewId.ResourceReference(), schemaName), @@ -535,7 +535,7 @@ func TestAcc_ShallowHierarchy_IsInConfig_RenamedExternally_WithoutDependency_Aft }, }, Config: config.FromModels(t, databaseConfigModel, schemaModelConfigWithNewDatabaseId), - ExpectError: regexp.MustCompile("Failed to create schema"), // already exists + ExpectError: regexp.MustCompile("Failed to create schema"), // already exists (because we try to create a schema on the renamed database that already has the schema that was previously created by terraform and wasn't removed) }, }, })