Skip to content

Commit f147ebf

Browse files
authored
chore(enterprise/audit): remove dbmem from tests (#18794)
Related to #15109.
1 parent 7f68191 commit f147ebf

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

enterprise/audit/audit_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"golang.org/x/xerrors"
99

1010
"github.com/coder/coder/v2/coderd/database"
11-
"github.com/coder/coder/v2/coderd/database/dbmem"
11+
"github.com/coder/coder/v2/coderd/database/dbtestutil"
1212
"github.com/coder/coder/v2/enterprise/audit"
1313
"github.com/coder/coder/v2/enterprise/audit/audittest"
1414
)
@@ -86,11 +86,12 @@ func TestAuditor(t *testing.T) {
8686
for _, test := range tests {
8787
t.Run(test.name, func(t *testing.T) {
8888
t.Parallel()
89+
db, _ := dbtestutil.NewDB(t)
8990

9091
var (
9192
backend = &testBackend{decision: test.backendDecision, err: test.backendError}
9293
exporter = audit.NewAuditor(
93-
dbmem.New(),
94+
db,
9495
audit.FilterFunc(func(_ context.Context, _ database.AuditLog) (audit.FilterDecision, error) {
9596
return test.filterDecision, test.filterError
9697
}),

enterprise/audit/backends/postgres_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"github.com/stretchr/testify/require"
88

99
"github.com/coder/coder/v2/coderd/database"
10-
"github.com/coder/coder/v2/coderd/database/dbmem"
10+
"github.com/coder/coder/v2/coderd/database/dbtestutil"
1111
"github.com/coder/coder/v2/enterprise/audit"
1212
"github.com/coder/coder/v2/enterprise/audit/audittest"
1313
"github.com/coder/coder/v2/enterprise/audit/backends"
@@ -20,7 +20,7 @@ func TestPostgresBackend(t *testing.T) {
2020

2121
var (
2222
ctx, cancel = context.WithCancel(context.Background())
23-
db = dbmem.New()
23+
db, _ = dbtestutil.NewDB(t)
2424
pgb = backends.NewPostgres(db, true)
2525
alog = audittest.RandomLog()
2626
)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy