Skip to content

Commit

Permalink
Remove test coverage for #178
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
kylejohnson committed Oct 31, 2023
1 parent c884a81 commit 8ba6bfd
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions postgresql/resource_postgresql_grant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 8ba6bfd

Please sign in to comment.