Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf147ebf

Browse files
authored
chore(enterprise/audit): remove dbmem from tests (#18794)
Related to#15109.
1 parent7f68191 commitf147ebf

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:=rangetests {
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
returntest.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)

[8]ページ先頭

©2009-2025 Movatter.jp