Skip to content

Commit

Permalink
fix: Update the tests after snowflake bugfix (#2806)
Browse files Browse the repository at this point in the history
- Snowflake behavior was fixed for ML class permissions (References:
#2651)
  • Loading branch information
sfc-gh-asawicki committed May 16, 2024
1 parent 54ea6bc commit 6843c1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1200,8 +1200,7 @@ func TestAcc_GrantPrivilegesToAccountRole_OnExternalVolume(t *testing.T) {
})
}

// proves https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2651
// TODO [SNOW-1270457]: This seems to be a Snowflake error, we are waiting for the confirmation. Alter the test when the behavior is fixed. Update the resource documentation (section known issues).
// proved https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2651
func TestAcc_GrantPrivilegesToAccountRole_MLPrivileges(t *testing.T) {
roleId := acc.TestClient().Ids.RandomAccountObjectIdentifier()
roleName := roleId.Name()
Expand Down Expand Up @@ -1245,10 +1244,9 @@ func TestAcc_GrantPrivilegesToAccountRole_MLPrivileges(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "with_grant_option", "false"),
resource.TestCheckResourceAttr(resourceName, "id", fmt.Sprintf("%s|false|false|CREATE SNOWFLAKE.ML.ANOMALY_DETECTION,CREATE SNOWFLAKE.ML.FORECAST|OnSchema|OnSchema|%s", roleFullyQualifiedName, schemaName)),
),
ExpectNonEmptyPlan: true,
ConfigPlanChecks: resource.ConfigPlanChecks{
PostApplyPostRefresh: []plancheck.PlanCheck{
plancheck.ExpectNonEmptyPlan(),
plancheck.ExpectEmptyPlan(),
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -918,8 +918,7 @@ func TestAcc_GrantPrivilegesToDatabaseRole_AlwaysApply(t *testing.T) {
})
}

// proves https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2651
// TODO [SNOW-1270457]: This seems to be a Snowflake error, we are waiting for the confirmation. Alter the test when the behavior is fixed. Update the resource documentation (section known issues).
// proved https://github.com/Snowflake-Labs/terraform-provider-snowflake/issues/2651
func TestAcc_GrantPrivilegesToDatabaseRole_MLPrivileges(t *testing.T) {
name := acc.TestClient().Ids.Alpha()
configVariables := config.Variables{
Expand Down Expand Up @@ -962,10 +961,9 @@ func TestAcc_GrantPrivilegesToDatabaseRole_MLPrivileges(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "with_grant_option", "false"),
resource.TestCheckResourceAttr(resourceName, "id", fmt.Sprintf("%s|false|false|CREATE SNOWFLAKE.ML.ANOMALY_DETECTION,CREATE SNOWFLAKE.ML.FORECAST|OnSchema|OnSchema|%s", databaseRoleName, schemaName)),
),
ExpectNonEmptyPlan: true,
ConfigPlanChecks: resource.ConfigPlanChecks{
PostApplyPostRefresh: []plancheck.PlanCheck{
plancheck.ExpectNonEmptyPlan(),
plancheck.ExpectEmptyPlan(),
},
},
},
Expand Down

0 comments on commit 6843c1a

Please sign in to comment.