From 8ba6bfd08f9677cb0c2114ac0caa074aafa42840 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Tue, 31 Oct 2023 15:09:52 -0400 Subject: [PATCH] Remove test coverage for https://github.com/cyrilgdn/terraform-provider-postgresql/issues/178 * Using terratest just wasn't working out - it isn't designed for testing a provider * github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource looks like the right option but I don't have the time to learn it right now. --- postgresql/resource_postgresql_grant_test.go | 51 -------------------- 1 file changed, 51 deletions(-) diff --git a/postgresql/resource_postgresql_grant_test.go b/postgresql/resource_postgresql_grant_test.go index 8636b188..a81c95bc 100644 --- a/postgresql/resource_postgresql_grant_test.go +++ b/postgresql/resource_postgresql_grant_test.go @@ -7,8 +7,6 @@ import ( "strings" "testing" - "github.com/gruntwork-io/terratest/modules/logger" - terratest "github.com/gruntwork-io/terratest/modules/terraform" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -302,55 +300,6 @@ func TestCreateRevokeQuery(t *testing.T) { } } -// Test the fix for -// https://github.com/cyrilgdn/terraform-provider-postgresql/issues/178 -func TestConcurrentPostgresqlGrant(t *testing.T) { - var testcases = []struct { - database_template string - superuser bool - }{ - { - "template0", - true, - }, - { - "template0", - false, - }, - { - "template1", - true, - }, - { - "template1", - false, - }, - } - - for _, testCase := range testcases { - testCase := testCase - name := fmt.Sprintf("%s-%t", testCase.database_template, testCase.superuser) - - t.Run(name, func(t *testing.T) { - t.Logf("Starting test loop with database template: %s and superuser: %t", testCase.database_template, testCase.superuser) - - terraformOptions := terratest.WithDefaultRetryableErrors(t, &terratest.Options{ - TerraformDir: "../examples/issues/178", - Logger: logger.Discard, - Vars: map[string]interface{}{ - "database_template": testCase.database_template, - "superuser": testCase.superuser, - }, - }) - - defer terratest.Destroy(t, terraformOptions) - - terratest.InitAndApply(t, terraformOptions) - }) - - } -} - func TestAccPostgresqlGrant(t *testing.T) { skipIfNotAcc(t)