Skip to content

Commit a578a37

Browse files
PLAT-1570 Changed around test parameters and added more error logging to fix tests
1 parent fc879bb commit a578a37

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

postgresql/resource_postgresql_alter_role.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ func alterRole(txn *sql.Tx, d *schema.ResourceData) error {
191191
query := createAlterRoleQuery(d)
192192
log.Println(query)
193193
if _, err := txn.Exec(query); err != nil {
194-
return fmt.Errorf("could not execute alter query testing message: %w", err)
194+
return fmt.Errorf("could not execute alter query: (%s): %w", query, err)
195195
}
196196
return nil
197197
}

postgresql/resource_postgresql_alter_role_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313

1414
func TestCreateAlterRoleQuery(t *testing.T) {
1515
var roleName = "foo"
16-
var parameterKey = "bar"
17-
var parameterValue = "foo"
16+
var parameterKey = "log_statement"
17+
var parameterValue = "ALL"
1818

1919
cases := []struct {
2020
resource map[string]interface{}
@@ -43,7 +43,7 @@ func TestCreateAlterRoleQuery(t *testing.T) {
4343

4444
func TestResetRoleQuery(t *testing.T) {
4545
var roleName = "foo"
46-
var parameterKey = "pgaudit.role"
46+
var parameterKey = "log_statement"
4747

4848
expected := fmt.Sprintf("ALTER ROLE %s RESET %s", pq.QuoteIdentifier(roleName), pq.QuoteIdentifier(parameterKey))
4949

@@ -77,7 +77,7 @@ func TestAccPostgresqlAlterRole(t *testing.T) {
7777

7878
_, roleName := getTestDBNames(dbSuffix)
7979

80-
parameterKey := "pgaudit.log"
80+
parameterKey := "log_statement"
8181
parameterValue := "ALL"
8282

8383
testAccPostgresqlAlterRoleResources := fmt.Sprintf(`
@@ -136,7 +136,7 @@ func checkAlterRole(t *testing.T, dsn, role string, parameterKey string, paramet
136136
)
137137

138138
case err != nil:
139-
t.Fatalf("could not check roles attributes: %v", err)
139+
t.Fatalf("could not check role attributes: %v", err)
140140
}
141141

142142
return nil

0 commit comments

Comments
 (0)