Skip to content

Commit

Permalink
Check
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Hume committed Nov 20, 2023
1 parent 2938f03 commit 2da2b7e
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions pkg/provider/acceptance_materialized_view_grant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestAccGrantMaterializedView_basic(t *testing.T) {
CheckDestroy: nil,
Steps: []resource.TestStep{
{
Config: testAccGrantMaterializedViewResource(roleName, materializedViewName, schemaName, databaseName, "default", privilege),
Config: testAccGrantMaterializedViewResource(roleName, materializedViewName, schemaName, databaseName, privilege),
Check: resource.ComposeTestCheckFunc(
testAccCheckGrantExists(
materialize.MaterializeObject{
Expand Down Expand Up @@ -61,7 +61,7 @@ func TestAccGrantMaterializedView_disappears(t *testing.T) {
CheckDestroy: nil,
Steps: []resource.TestStep{
{
Config: testAccGrantMaterializedViewResource(roleName, materializedViewName, schemaName, databaseName, "default", privilege),
Config: testAccGrantMaterializedViewResource(roleName, materializedViewName, schemaName, databaseName, privilege),
Check: resource.ComposeTestCheckFunc(
testAccCheckGrantExists(o, "materialize_materialized_view_grant.materialized_view_grant", roleName, privilege),
testAccCheckGrantRevoked(o, roleName, privilege),
Expand All @@ -73,32 +73,26 @@ func TestAccGrantMaterializedView_disappears(t *testing.T) {
})
}

func testAccGrantMaterializedViewResource(roleName, materializedViewName, schemaName, databaseName, clusterName, privilege string) string {
func testAccGrantMaterializedViewResource(roleName, materializedViewName, schemaName, databaseName, privilege string) string {
return fmt.Sprintf(`
resource "materialize_role" "test" {
name = "%s"
name = "%[1]s"
}
resource "materialize_database" "test" {
name = "%s"
name = "%[2]s"
}
resource "materialize_schema" "test" {
name = "%s"
name = "%[3]s"
database_name = materialize_database.test.name
}
resource "materialize_cluster" "test" {
name = "test"
size = "3xsmall"
replication_factor = 1
}
resource "materialize_materialized_view" "test" {
name = "%s"
name = "%[4]s"
schema_name = materialize_schema.test.name
database_name = materialize_database.test.name
cluster_name = "%s"
cluster_name = "default"
depends_on = [materialize_cluster.test]
Expand All @@ -110,10 +104,10 @@ resource "materialize_materialized_view" "test" {
resource "materialize_materialized_view_grant" "materialized_view_grant" {
role_name = materialize_role.test.name
privilege = "%s"
privilege = "%[5]s"
database_name = materialize_database.test.name
schema_name = materialize_schema.test.name
materialized_view_name = materialize_materialized_view.test.name
}
`, roleName, databaseName, schemaName, materializedViewName, clusterName, privilege)
`, roleName, databaseName, schemaName, materializedViewName, privilege)
}

0 comments on commit 2da2b7e

Please sign in to comment.