Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jcieslak committed Oct 14, 2024
1 parent e5518f3 commit 8456b56
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ func TestAcc_DeepHierarchy_AreInConfig_DatabaseRenamedInternally(t *testing.T) {
{DatabaseDependency: ImplicitDependency, SchemaDependency: ImplicitDependency, DatabaseInSchemaDependency: DependsOnDependency},
{DatabaseDependency: ImplicitDependency, SchemaDependency: DependsOnDependency, DatabaseInSchemaDependency: DependsOnDependency},

//{DatabaseDependency: ImplicitDependency, SchemaDependency: NoDependency, DatabaseInSchemaDependency: NoDependency}, // fails after incorrect execution order (tries to drop schema after database was dropped); cannot assert
// {DatabaseDependency: ImplicitDependency, SchemaDependency: NoDependency, DatabaseInSchemaDependency: NoDependency}, // fails after incorrect execution order (tries to drop schema after database was dropped); cannot assert
// {DatabaseDependency: ImplicitDependency, SchemaDependency: ImplicitDependency, DatabaseInSchemaDependency: NoDependency}, // tries to drop schema after database name was changed; cannot assert
// {DatabaseDependency: ImplicitDependency, SchemaDependency: DependsOnDependency, DatabaseInSchemaDependency: NoDependency}, // tries to drop schema after database name was changed; cannot assert

Expand All @@ -918,7 +918,7 @@ func TestAcc_DeepHierarchy_AreInConfig_DatabaseRenamedInternally(t *testing.T) {
}

for _, testCase := range testCases {
t.Run(fmt.Sprintf("database dependency: %s, schema dependency: %s, database in schema dependency: %s", testCase.DatabaseDependency, testCase.SchemaDependency, testCase.DatabaseInSchemaDependency), func(t *testing.T) {
t.Run(fmt.Sprintf("TestAcc_ database dependency: %s, schema dependency: %s, database in schema dependency: %s", testCase.DatabaseDependency, testCase.SchemaDependency, testCase.DatabaseInSchemaDependency), func(t *testing.T) {
databaseId := acc.TestClient().Ids.RandomAccountObjectIdentifier()
newDatabaseId := acc.TestClient().Ids.RandomAccountObjectIdentifier()
schemaName := acc.TestClient().Ids.Alpha()
Expand Down Expand Up @@ -989,7 +989,7 @@ func TestAcc_DeepHierarchy_AreInConfig_SchemaRenamedInternally(t *testing.T) {
}

for _, testCase := range testCases {
t.Run(fmt.Sprintf("database dependency: %s, schema dependency: %s", testCase.DatabaseDependency, testCase.SchemaDependency), func(t *testing.T) {
t.Run(fmt.Sprintf("TestAcc_ database dependency: %s, schema dependency: %s", testCase.DatabaseDependency, testCase.SchemaDependency), func(t *testing.T) {
databaseId := acc.TestClient().Ids.RandomAccountObjectIdentifier()
schemaName := acc.TestClient().Ids.Alpha()
newSchemaName := acc.TestClient().Ids.Alpha()
Expand Down Expand Up @@ -1061,7 +1061,7 @@ func TestAcc_DeepHierarchy_AreInConfig_DatabaseRenamedExternally(t *testing.T) {
}

for _, testCase := range testCases {
t.Run(fmt.Sprintf("database dependency: %s, schema dependency: %s, database in schema dependency: %s", testCase.DatabaseDependency, testCase.SchemaDependency, testCase.DatabaseInSchemaDependency), func(t *testing.T) {
t.Run(fmt.Sprintf("TestAcc_ database dependency: %s, schema dependency: %s, database in schema dependency: %s", testCase.DatabaseDependency, testCase.SchemaDependency, testCase.DatabaseInSchemaDependency), func(t *testing.T) {
databaseId := acc.TestClient().Ids.RandomAccountObjectIdentifier()
newDatabaseId := acc.TestClient().Ids.RandomAccountObjectIdentifier()
schemaName := acc.TestClient().Ids.Alpha()
Expand Down Expand Up @@ -1132,7 +1132,7 @@ func TestAcc_DeepHierarchy_AreInConfig_SchemaRenamedExternally(t *testing.T) {
}

for _, testCase := range testCases {
t.Run(fmt.Sprintf("database dependency: %s, schema dependency: %s, database in schema dependency: %s", testCase.DatabaseDependency, testCase.SchemaDependency, testCase.DatabaseInSchemaDependency), func(t *testing.T) {
t.Run(fmt.Sprintf("TestAcc_ database dependency: %s, schema dependency: %s, database in schema dependency: %s", testCase.DatabaseDependency, testCase.SchemaDependency, testCase.DatabaseInSchemaDependency), func(t *testing.T) {
databaseId := acc.TestClient().Ids.RandomAccountObjectIdentifier()
schemaId := acc.TestClient().Ids.RandomDatabaseObjectIdentifierInDatabase(databaseId)
newSchemaId := acc.TestClient().Ids.RandomDatabaseObjectIdentifierInDatabase(databaseId)
Expand Down Expand Up @@ -1190,7 +1190,7 @@ func TestAcc_DeepHierarchy_AreNotInConfig_DatabaseRenamedExternally(t *testing.T
}

for _, testCase := range testCases {
t.Run(fmt.Sprintf("use new database after rename: %t", testCase.UseNewDatabaseNameAfterRename), func(t *testing.T) {
t.Run(fmt.Sprintf("TestAcc_ use new database after rename: %t", testCase.UseNewDatabaseNameAfterRename), func(t *testing.T) {
newDatabaseId := acc.TestClient().Ids.RandomAccountObjectIdentifier()
tableName := acc.TestClient().Ids.Alpha()

Expand Down Expand Up @@ -1247,7 +1247,7 @@ func TestAcc_DeepHierarchy_AreNotInConfig_SchemaRenamedExternally(t *testing.T)
}

for _, testCase := range testCases {
t.Run(fmt.Sprintf("use new database after rename: %t", testCase.UseNewSchemaNameAfterRename), func(t *testing.T) {
t.Run(fmt.Sprintf("TestAcc_ use new database after rename: %t", testCase.UseNewSchemaNameAfterRename), func(t *testing.T) {
database, databaseCleanup := acc.TestClient().Database.CreateDatabase(t)
t.Cleanup(databaseCleanup)

Expand Down
3 changes: 2 additions & 1 deletion pkg/sdk/testint/errors_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package testint

import (
"context"
"testing"

"github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk"
"github.com/stretchr/testify/assert"
"testing"
)

func schemaObjectShowByIDWrapper[T any](showByIdFn func(context.Context, sdk.SchemaObjectIdentifier) (*T, error)) func(context.Context, sdk.SchemaObjectIdentifier) error {
Expand Down

0 comments on commit 8456b56

Please sign in to comment.