Skip to content

Commit

Permalink
Fix tests again...
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jmichalak committed Jul 26, 2024
1 parent 5a190b0 commit 95400fb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
10 changes: 6 additions & 4 deletions pkg/resources/schema_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,14 @@ func TestAcc_Schema_TwoSchemasWithTheSameNameOnDifferentDatabases(t *testing.T)

// proves https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2356 issue is fixed.
func TestAcc_Schema_DefaultDataRetentionTime(t *testing.T) {
databaseId := acc.TestClient().Ids.DatabaseId()
id := acc.TestClient().Ids.RandomDatabaseObjectIdentifier()
db, dbCleanup := acc.TestClient().Database.CreateDatabase(t)
t.Cleanup(dbCleanup)

id := acc.TestClient().Ids.RandomDatabaseObjectIdentifierInDatabase(db.ID())

configVariablesWithoutSchemaDataRetentionTime := func() config.Variables {
return config.Variables{
"database": config.StringVariable(databaseId.Name()),
"database": config.StringVariable(db.ID().Name()),
"schema": config.StringVariable(id.Name()),
}
}
Expand Down Expand Up @@ -584,7 +586,7 @@ func TestAcc_Schema_DefaultDataRetentionTime(t *testing.T) {
// change param value in database
{
PreConfig: func() {
acc.TestClient().Database.UpdateDataRetentionTime(t, databaseId, 50)
acc.TestClient().Database.UpdateDataRetentionTime(t, db.ID(), 50)
},
ConfigDirectory: acc.ConfigurationDirectory("TestAcc_Schema_DefaultDataRetentionTime/WithoutDataRetentionSet"),
ConfigVariables: configVariablesWithoutSchemaDataRetentionTime(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ resource "snowflake_database" "test" {
}

resource "snowflake_schema" "test" {
database = snowflake_database.test.name
name = var.schema
data_retention_days = var.schema_data_retention_time
database = snowflake_database.test.name
name = var.schema
data_retention_time_in_days = var.schema_data_retention_time
}

resource "snowflake_table" "test" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ resource "snowflake_database" "test" {
}

resource "snowflake_schema" "test" {
database = snowflake_database.test.name
name = var.schema
data_retention_days = var.schema_data_retention_time
database = snowflake_database.test.name
name = var.schema
data_retention_time_in_days = var.schema_data_retention_time
}

resource "snowflake_table" "test" {
Expand Down

0 comments on commit 95400fb

Please sign in to comment.