Skip to content

Commit 89db6cd

Browse files
author
tony-landreth
committed
Updates test
1 parent 30e8e5b commit 89db6cd

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

internal/pgmonitor/postgres_test.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package pgmonitor
66

77
import (
8+
"context"
89
"strings"
910
"testing"
1011

@@ -15,10 +16,12 @@ import (
1516
)
1617

1718
func TestPostgreSQLHBA(t *testing.T) {
19+
ctx := context.Background()
20+
1821
t.Run("ExporterDisabled", func(t *testing.T) {
1922
inCluster := &v1beta1.PostgresCluster{}
2023
outHBAs := postgres.HBAs{}
21-
PostgreSQLHBAs(inCluster, &outHBAs)
24+
PostgreSQLHBAs(ctx, inCluster, &outHBAs)
2225
assert.Equal(t, len(outHBAs.Mandatory), 0)
2326
})
2427

@@ -33,7 +36,7 @@ func TestPostgreSQLHBA(t *testing.T) {
3336
}
3437

3538
outHBAs := postgres.HBAs{}
36-
PostgreSQLHBAs(inCluster, &outHBAs)
39+
PostgreSQLHBAs(ctx, inCluster, &outHBAs)
3740

3841
assert.Equal(t, len(outHBAs.Mandatory), 3)
3942
assert.Equal(t, outHBAs.Mandatory[0].String(), `host all "ccp_monitoring" "127.0.0.0/8" scram-sha-256`)
@@ -43,10 +46,12 @@ func TestPostgreSQLHBA(t *testing.T) {
4346
}
4447

4548
func TestPostgreSQLParameters(t *testing.T) {
49+
ctx := context.Background()
50+
4651
t.Run("ExporterDisabled", func(t *testing.T) {
4752
inCluster := &v1beta1.PostgresCluster{}
4853
outParameters := postgres.NewParameters()
49-
PostgreSQLParameters(inCluster, &outParameters)
54+
PostgreSQLParameters(ctx, inCluster, &outParameters)
5055
assert.Assert(t, !outParameters.Mandatory.Has("shared_preload_libraries"))
5156
})
5257

@@ -61,7 +66,7 @@ func TestPostgreSQLParameters(t *testing.T) {
6166
}
6267
outParameters := postgres.NewParameters()
6368

64-
PostgreSQLParameters(inCluster, &outParameters)
69+
PostgreSQLParameters(ctx, inCluster, &outParameters)
6570
libs, found := outParameters.Mandatory.Get("shared_preload_libraries")
6671
assert.Assert(t, found)
6772
assert.Assert(t, strings.Contains(libs, "pg_stat_statements"))
@@ -80,7 +85,7 @@ func TestPostgreSQLParameters(t *testing.T) {
8085
outParameters := postgres.NewParameters()
8186
outParameters.Mandatory.Add("shared_preload_libraries", "daisy")
8287

83-
PostgreSQLParameters(inCluster, &outParameters)
88+
PostgreSQLParameters(ctx, inCluster, &outParameters)
8489
libs, found := outParameters.Mandatory.Get("shared_preload_libraries")
8590
assert.Assert(t, found)
8691
assert.Assert(t, strings.Contains(libs, "pg_stat_statements"))

0 commit comments

Comments
 (0)